We are using an ultrasonic sensor to determine range from the target, since I believe using the vision itself to determine range is less reliable/accurate. That said, if you are still interested in doing it with vision, GeeTwo gave a good answer to this in another thread:
Quote:
Originally Posted by GeeTwo
If you're asking what I think you're asking, use the height of the retroreflective area. Its actual height 5". Divide that by the number of pixels of its height, and you have a good estimate of the image resolution in a direction perpendicular to a (presumably horizontal) camera, and can roughly calculate range.
Alternately, just measure the height in pixels (P0) at a known range R0 (say 10 feet). Then whenever you're looking at the target, R = R0 * P0 / P. Should be close enough to get you going, but it breaks down as you get close to the target and the sine of the angle is no longer proportional to the angle.
|