|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Calculate translational distance from vision
I have some experience from last year converting a target location in pixels to an offset in degrees using the FOV of the camera, but I am not sure how to apply that to this year's vision challenge. We are looking to align with the gear peg laterally using vision. Is there a similar equation for converting pixels to translational distance? (Distance we need to slide laterally to get lined up with the peg)
Sent from my iPhone using Tapatalk |
|
#2
|
||||
|
||||
|
Re: Calculate translational distance from vision
You'll need to know the distance to the target to make it work.
Pretend the above is a top view of the camera. O is the lens. Y1 is the camera sensor. y1 is the number of pixels off center you are. f is the focal length of the camera. Those are all known locations & values. So this is a simple similar triangle calculation, if you just know x3. The problem is that all the pixels along the green line outside of the camera will show up at the same point Q on the sensor. So without knowing the distance x3 you can't figure out how big x1 is (P could be at any point along the green line). If you can determine distance x3 some other way (ultrasonic, some trig using the distance between the two vision targets) x1 is easy. But any error in x3 will also be an error in x1 so testing is in order. Last edited by KJaget : 24-01-2017 at 09:43. |
|
#3
|
||||
|
||||
|
Re: Calculate translational distance from vision
Quote:
|
|
#4
|
|||||
|
|||||
|
Re: Calculate translational distance from vision
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. |
|
#5
|
|||
|
|||
|
Re: Calculate translational distance from vision
bump
|
|
#6
|
|||
|
|||
|
Re: Calculate translational distance from vision
bump2
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|