Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining Accurate Line Lengths Using the polyline tool

I am interested in getting accurate length information for a line drawn with the polyline tool.  As an example, say I have five line segments that make up the polyline, with each segment of the polyline line drawn at a different angle.  IMAQ ROIProfile will deliver pixel coordinates once the line is ended, but is there a way to get ahold of the individual segment start and end point coordinates?  If I could get access to the start and end points of each section, I can calculate line length of each segment based on the number of pixels and angle that the segment was drawn through.  Then I could just add the segment lengths together.  I am not sure how to use the information coming out of IMAQ ROIProfile to do what I need to here. Perhaps there is another approach that I have not thought of.

0 Kudos
Message 1 of 3
(5,065 Views)

Don,

 

If you just unbundle the ROI, you can get the data you want.  It will take a little work to figure out the format, but it isn't too difficult.  If I remember correctly, the points are listed as alternating X and Y values in an array inside the ROI.  If you create a polyline then examine the ROI you should be able to figure it out pretty quickly.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 3
(5,062 Views)

Sorry, duplicate post.

Bruce Ammons
Ammons Engineering
0 Kudos
Message 3 of 3
(5,062 Views)