View Single Post
  #10   Spotlight this post!  
Unread 09-02-2012, 17:04
jesusrambo jesusrambo is offline
Self-Proclaimed Programmer Messiah
AKA: JD Russo
FRC #2035 (Robo Rockin' Bots)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Carmel, CA
Posts: 114
jesusrambo is an unknown quantity at this point
Re: Distance Algorithm

Here you go.

I have this as a separate VI right inside my image processing loops.

Basically what this does is:

(Actual width of the target in ft * Y Resolution of camera image) / (The processed rectangle's height in pixels) / 2 / (the tangent of the camera's FOV/2)

Be very careful with the number you're using for FOV. The spec sheets all give you the FOV in degrees, and I used radians in my labview.

EDIT: I accidentally have width*x_res writte in that image, that should be y_res if you're using the height of the rectangle
Attached Images
File Type: bmp rangefindingVI.bmp (1.39 MB, 49 views)

Last edited by jesusrambo : 10-02-2012 at 01:33.
Reply With Quote