LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

imaq point distances

I want to be able to trace a line on top of an image and using the IMAQ point distances tool determine de length in pixels of the line. I am having trouble converting the xy coordinates from the ROI tool to the right format input for the IMAQ point distances tool.
0 Kudos
Message 1 of 6
(3,945 Views)
Rico,
 
Which ROI tool are you using?  The function that you are using is important in figuring out how to format the coordinate data.  For example, if you are using the IMAQ ROIProfile function, then you would probably want to use the "Global Rectangle" output.  Also, are you using LabVIEW or another programming environment?  Any specific details you can give would be helpful.
 
Chris M.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(3,923 Views)
Chris,
 
I am using the Machine vision tools out of Labview 8.0. What I want out of my VI is:
 
To be able to measure the shortest distance between two points.
 
For that matter, I used IMAQ Clamp horizontal Min, but the problem is that this function would not give a a true distance if the points are not horizontal. So, I used the line tool from the ROI toolbox and by tracing a line on top of the image, get the distance between the endpoints of the line. For that I used IMAQ Point Distances.
 
If there is a better way to do it I am all up for it, but in any case I attached the VI if you want to take a look at it.
 
Regards,
 
Rico
0 Kudos
Message 3 of 6
(3,921 Views)

Rico,

I am attaching a VI that computes the length (in pixels) of a line drawn in an external display.  There are many ways to do this, and this example may not be the most optimal to your application, but hopefully it will help demonstrate how to convert the data.  Please let me know if this is helpful.

Chris M.
Applications Engineer
National Instruments

0 Kudos
Message 4 of 6
(3,913 Views)

Chris,

I think what I am having the most trouble with is figuring out the type of inputs that the function "point distances" would take to give the right result. I will use the later portion of the VI you posted into my VI to see if I get what I need.

Regards,

Ricardo

0 Kudos
Message 5 of 6
(3,905 Views)

Ricardo,

The IMAQ Point Distances VI accepts an input that is an array of clusters.  Each cluster contains two integer values corresponding to X and Y coordinates.  The array must contain at least two clusters (each cluster representing a point), and the output will be an array of distances corresponding the the number of line segments defined by the points.  For example, if the input contains two data points, then the output will contain one number.  If the input contains three data points, then the output will contain two numbers.  Let me know if this helps.

Chris M.
Applications Engineer
National Instruments

0 Kudos
Message 6 of 6
(3,892 Views)