I am wondering how to go about localising a robot in a rectangle drawn on a smooth surface. Basically, there is a tape that lines the shape of the rectangle, and the color of this tape is unique in the scene. I have a camera mounted on the robot. So my question is, is it possible using image processing, and knowing the size of the rectangle, to localise the robot within this rectangle so it may navigate the area of the rectangle. Obviously the robot is driving in the same plane as the rectangle. Thanks
-
$\begingroup$ Please be more specific, where on the robot is the camera? What do you mean by saying localize? Best case scenario you calculate your distance from the lines (and/or from the corners) but you can't figure out the orientation of the robot. $\endgroup$– nioniosCommented Nov 28, 2019 at 17:51
-
$\begingroup$ The camera is above the robot, orientated slightly downward so it can see the floor infront of the robot. Localise as in know where in the rectangle the robot is based on a most likely prediction. Would the corners of the rectangle not be able to provide an idea of orientation? $\endgroup$– SupanovaZACommented Nov 28, 2019 at 17:59
-
$\begingroup$ Imagine that you see 1 or 2 corners, if there nothing more differentiating them from the others, it is almost impossible to understand which 2 corners you are looking at. I think that you need something more over there, like a different color $\endgroup$– nioniosCommented Nov 28, 2019 at 22:14
-
$\begingroup$ It is possible to use different colours. That is definitely not out of the question. So assuming I had a unique colour per side/corner, are there any computer vision or similar algorithms that might help? $\endgroup$– SupanovaZACommented Nov 29, 2019 at 12:10
1 Answer
If you know the color and also how long the line is then, you can detect it (easy color detection with opencv) and estimate the distance between the line and the camera.
Basic concept you find how many pixels the line is occuping on the picture, you can find the focal length of your camera (from the manual) and you know also the actual size of the line in the real world so you can estimate the distance of the camera to the line.
as you can see in the picture