04-24-2017 06:19 PM
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
Solved! Go to Solution.
04-25-2017 09:34 AM
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?
04-25-2017 04:31 PM
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
04-26-2017 05:12 PM
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.
04-27-2017 01:28 AM
04-27-2017 03:24 PM
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
04-27-2017 05:33 PM
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.
04-28-2017 01:32 AM