Borrow someone's digital camera, keep it at a height of about 30 cm (your robot height), and take an image of a corridor with some dirt on it.
"Dirt" can be anything - papers, clothes, dirt, cups, etc. With respect to the image you have shot:
Qs) How would you determine where the floor lies in the image, and where there are walls etc. state any assumptions of prior knowledge you need to make.
Ans: I take the following reasonable assumptions -
- - Robot knows the height of the camera to be 30cm
- - Robot is able to detect difference in texture / sharp edges
Firstly with the respect to the image we first establish our base surface or the floor. This can be done by figuring out the line AB and AC. Line AB can be figured
out using texture difference or filter technique [as there is a sharp contrast]. We know that floor boundaries are straight so we can smooth the line AB.
Line AC is more difficult to detect since color or intensity is nearly same on both side hence we will use texture detection technique.Once we establish these
two lines we know the floor area is the area bounded inward by these two lines. To detect the wall we use the fact that walls are orthogonal to floor and are
generally smooth. Moreover we already know the floor so we look at surfaces near the floor boundary. If these areas are smooth we detect them as
wall.Smoothness ensures that the grassy region is not detected as wall.
Qs) Use a grid size of 0.5m, and indicate how the location of the dirt can be mapped to a grid
Ans: The robot will divide the image into grid according to the grid size. Then it will use filters or other techniques to find intensity
variations in each grid. Example we can take a Canny filter or Gaussian filter. Finally based on the variation in each grid we assign parameter
to a grid and represent it in a 2D matrix.
Qs) Would a value between 0 and 1 be good enough to map the "dirt" in each grid?
Ans: It will not be good enough for the reason that dirt is characterized by intensity variation, texture difference, height and shape etc. hence
a single number between [0,1] will not be a good choice for mapping dirt. Example if we take intenstiy difference then edges of wall etc. will
also be mapped as dirt.
Qs) Consider how the robot might determine its own position using the image?
Ans: First the robot identifies the two lines AB and AC. It sees that only edges of floor has come hence it must be opposite the corner (somewhat). Similarly if three edges come then it is opposite to the center edge. I make two assumptions at this point which are very reasonanble -
- - Robot knows the height of its camera which is 30cm
- - It knows the angle subtended by its camera
Since we have been able to figure out the edges of floor we can imagine grids on the floor parallel to line AB and AC. We take A as the origin of this grid and
join the center of the image to the point A. Further using the knowledge of camera angle and height we can calculate the distance between center of image and the
robot. Combining these two distances we get the distance from the point A or from line AB and AC. Since the leave [dirt] also has a coordinate in this grid we know
the location of the leaf as well as the relative location of robot and leaf. Without some assumption it is not possible for robot to find its absolute location.