|
Re: How do I get distance between Camera and the target?
Math.
If the target is centered, then:
(goal_height - camera_height) / tan(camera_tilt) = range
The problem is implementing a tan() function on the PIC - check the Whitepapers on Delphi for a few ways to do this (search for CORDIC).
Also, if the target is not centered, then you have to convert the vertical pixel error into an angle and add that to the camera_tilt value. This requires that you know the field of view angle of the camera lens.
|