From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Find Edge shows straight edge beyond part

Hello

 

I am working on finding the sides of my simple part with the IMAQ Find Edge tool. To make it simple, I gave my image an extreme threshold with IMAQ Threshold manually set 0 - 230 so My part basically shows up Black against a white background. I set the ROI of the Part from IMAQ Count Objects 2, expanded that ROI by a couple pixels on each corner of the bounding box and input that into my IMAQ Find Edge tool. I have two IMAQ Find Edges, one looking left to right finding all edges and the other top to bottom finding all edges. It took a while, but I have all Straight edges appearing using the results from Find Edge.

 

What I don't understand is why these lines are longer than the edges of the part sides? I have attached the image to show what I mean. The edges (yellow) are clearly found on the part, but the resulting lines (red) are beyond these points. 

 

Kelsi

0 Kudos
Message 1 of 4
(4,903 Views)

The reason the line extends beyond the edge is because what you are being shown is the edge position in space,  Not an edge with some corners, or something else.

 

In other words, the find edge function doesn't know anything about what constitutes the end of an edge.  The lines that are drawn are very useful, because you can use them along with other edges you have found to do things like find corners (intersections), and measure width of a part (clamp).

 

The best way to familiarize yourself with the possibilities is to explore the edge and geometry features using Vision Assistant.  You can also export VA scripts as LabVIEW code, although it is somewhat hard to read in some cases.

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 2 of 4
(4,894 Views)

I was hoping that somehow it may also see the edges. I tried throwing the edge detect over the lines to see the ends, but it is not as accurate or very repeatable as finding intersects.

 

I used the Intersect tool also in IMAQ and realized it is finding intersects based on the equation of the line and not the line segment, so it returns intersections far beyond the segment if I just find intersects of all lines with out being able to tell LabVIEW the order of which the lines are about the object. I am working on putting a logical VI to throw out intersections found outside the bounds of the line segments, but I am hoping there is a better way.

 

I have not found anything showing the Bentley–Ottmann Algorithm in order to work around this. I don't know if anyone else has tried to implement this.

 

I saw that LabVIEW has a convex hull function in the geometry pallette, so once I find the intersection points I will have what I need, I believe.

 

Thanks!

 

Kelsi

0 Kudos
Message 3 of 4
(4,880 Views)

Also am I setting up my edge detect functions wrong? I am filtering my image so I only see the object, no shadows. I am thresholding the image to basically outline it. Now I am using the edge detect function to find the edges and it can't seem to find them all. I have an object that I set my ROI about it, and I have the settings for the edge detect on very low to detect basically any edges possible. It still does not consistently see the edges of my object.

 

Is there a more reliable way to consistently see these edges?

 

Kelsi

Download All
0 Kudos
Message 4 of 4
(4,870 Views)