a) Under the assumptions that the lighting is uniform and the color of dirt is very different from the color of floor, using edge detection we can detect the walls and dirt using image processing. b) After detecting the wall's edges and the floor, we can divide the floor according to the size of the grid given. Since I have assumed very different colors of the floor and dirt, the color occupying the maximum area will be that of the floor. Using this information, we can analyze each square and calculate the fraction of area occupied by dirt and assign that value to that square. c)Any fraction can be represented by a value between 0 and 1. Hence, it is a good enough to map the dirt value in this interval. d)If the camera is centrally placed on the robot and is facing downwards, the height of the robot being fixed, it should lie somewhere near the centre of the image