|
Re: How can angle offset of a shooter be calculated from pixel offset?
It's fairly simple. It's (pixels from center) / (camera pixel width) * FOV
For example, your camera has a field of view (FOV) of 45 degrees, your camera width is 320 pixels, and your image is 16 pixels off center. Then the angle to aim is:
(320 pixles/16 pixels) * 45 degrees = 2.25 degrees
You can calibrate your exact camera FOV by pointing your camera at a white board and marking two points on the white board at the left and right edge of the camera image. Then measure the distance between the two points on the white board, and the distance between the white board and the camera. Then a little trig will give you the FOV.
__________________
-
An ounce of perception is worth a pound of obscure.
|