|
Re: Camera Distance Calcualtor for Labview
What you are going to want to do is find a modeling equation and then use that. The apparent size of the target and the distance have a relationship approximated by D=sqrt(k/A), where k is a constant and A is the apparent area of the target (in this case, in pixels). You will need to take a few data points of distance and area to find a good K value. It should be approximately constant throughout all data points. If it isn't, the tracking color ranges are probably not catching all of the target in the current conditions, or the target is not pointed directly at the camera. This formula works best when the camera is near-level with the target.
Other possibilities include finding the angle the camera is pointing, and knowing the height of the target, use trigonometry to find an approximate distance.
__________________
D5 Robotics, Team 1293: Programmer, CAD'er, Mechanical, Electrical... I've made my rounds.
Events: 2006-2009 Palmetto Regional
Website: http://d5robotics.org/
|