LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ROI for Edge Detection

Solved!
Go to solution

Hi all, this is my first time posting on these forums, so please bear with me.

 

I have been working on a machine vision project that utilizes edge detection of a chip to check its alignment in a larger part, as part of a quality assurance project for my company. I have noticed that I get much better results for some regions of interest when I rotate the ROI by 180 degrees, and flip the search direction. For example, if I was searching for rising edges in a "top to bottom" direction, I could possibly get a higher score for the line that is found by rotating the ROI 180 degrees and searching "bottom to top". Theoretically, this should not make any difference and should produce the same results. I am also not seeing a pattern in which ROIs would be better off rotated, and which ones I should leave un-rotated; I can only test each one individually. Does anyone know why this is happening? Is it possibly something in the algorithm that makes a particular search direction better than others?

 

Unfortunately, I cannot post my code, as it is proprietary, but please let me know if you have further questions.

 

Thank you,

raoviswa

0 Kudos
Message 1 of 8
(3,987 Views)

Would you be able to post any images for which you see this behavior and describe where the ROI would be if you cannot directly post any code?

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 8
(3,912 Views)

Hi Matt,

I attached an image of the bottom of a chip with an ROI around it. It isn't the best quality, but the machine is not accessible to me right now so this was all I could get. This line gave me a score of about 70, and that is when the ROI is rotated and the search direction set to "top to bottom". If I do not rotate it, and have the search direction "bottom to top" I am getting a score of around 40. Sometimes the difference is even more pronounced, like scores of 120 vs. 65. Any ideas on what could be causing this?

 

Thank you,

Viswa Rao

0 Kudos
Message 3 of 8
(3,902 Views)

Hmmm, I tried this with a snap of my desktop background and saw the same behavior that you were describing as well. I can't think of any reason why this would be the case and can't find any reason given in the edge detection section of the Vision Concepts Help manual. I also tried searching for any CARs but still came up empty handed.

 

I'll ask some people I work with tomorrow to see what they think.

Matt J | National Instruments | CLA
0 Kudos
Message 4 of 8
(3,884 Views)
Which environment you are using? LabVIEW or Vision Assistant.
- which edge detection vi you are using?
- when you change direction do you change the edge polarity?
- what are the edge settings and detection type?
- do you check for all edges or first, last ?
Thanks
uday
0 Kudos
Message 5 of 8
(3,875 Views)

I am using LabVIEW 2012, and the edge detection VI is "IMAQ Find Edge".

 

When I rotate the ROI 180 degrees, the search direction gets flipped as well. For example, if I rotate the ROI, and choose "top to bottom", the direction of the search lines will be pointing up. So yes, I change the edge polarity.

 

I use all the default options for the Edge Options and Line Fit Options (bilinear fixed interpolation type, first edge rake, etc.). Except, I specify if I'm looking for a rising edge or a falling edge for every line I'm trying to find. I do not use "all edges".

 

Thanks,

Viswa Rao

0 Kudos
Message 6 of 8
(3,867 Views)

I don't have IMAQ so I can't test this myself, but have you checked for different results when rotating versus mirroring?  

 

I.E., if your initial image was 3x3 with these pixels:

 

123

456

789

 

Rotation 180 gets:

 

987

654

321

 

But mirroring gets:

 

789

456

123

 

It would help you narrow down whether the difference is due to traveling up vs down looking for edges, or if the problem is the search scan direction changing from left to right.

 

You could also try switching the images to their negatives to see if that alters the results in a surprising way.

0 Kudos
Message 7 of 8
(3,855 Views)
Solution
Accepted by topic author raoviswa
Unless your image is having contrast at 1 pixel and it can differentiate, it would be difficult to expect same edge when you reverse the ROI.
- you are looking at that too first edge, means in the search direction whatever edge appears it takes it and then does line fit.
- instead try best edge to reduce the difference.
- read more on edge detection here : https://zone.ni.com/reference/en-XX/help/370281AC-01/nivisionconcepts/edge_detection_concepts/
Thanks
uday
Message 8 of 8
(3,852 Views)