Here's my problem:
Suppose there's a course for robots to go through, and there's an overhead webcam that can see the whole of it, and which the robot can use to navigate. Now the question is, what's the best way to detect the robot (position and heading) on the image of this webcam? I was thinking about a few solutions, like putting leds on it, or two separate colored circles, but those doesn't seem to be the best way to do it.
Is there a better solution to this, and if yes, I would really appreciate some opencv2 python code example of it, as I'm new to computer vision.
I'd do the following, and I'm pretty sure it would work:
I assume that the background of the video stream (the robots vicinity) is pretty static, so the firs step is:
1. background subtraction
2. detect movement in the foreground, this is your robot and everything else that changes from the background model, you'll need some thresholding here
3. connected-component detection to get the blobs
4. identify the blob corresponding to the robot (biggest?)
5. now you can get the coordinates of the blob
6. you can compute the heading if you track your blob through multiple frames
you can find good examples by googling the keywords
Distinctive color would work with color filtering and template matching and the likes, but the above method is more general.
How can I detect my robot from an overhead webcam image?