Quote:
|
Originally Posted by Abwehr
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.
|
tan() is included in the latest version of C18 compiler (2.4 I believe)
It has been this way since (at least) last year.