|
Re: Visual Tracking Help
If you know the vertical pixel position of the target in your camera image and the vertical field of view of the camera in both pixels and degrees, you can compute the vertical angle from the camera to the target.
If you know the vertical angle to the target, the height of the target, and the height of the camera, you can compute both the horizontal distance to a point directly beneath the target and the straight-line diagonal distance to the target.
The vertical field of view of the camera in pixels is a constant (720 pixels for a 720p image). The field of view in degrees is also a constant that you can measure. The height of the target is a constant, defined in the field drawings. The height of the camera is something you can define for yourself.
Once you have the location of the target in the image, finding distance is a matter of simple trigonometry.
|