LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI Vision Geometric Matching not working reliably, need help

Good afternoon,

I am having issues with NI Vision Geometric Matching, where 9/10 times in my machine inspection application the template would be easily detected and 1/10 it would not be detected no matter what I change the edge threshold (for the detector) to, I have it set to 20 now, when the default is 75 or the matching score (my score set to 200, where the defult is 700). Nothing works for those 1/10 attempts. The template I'm matching is taken from an image the same exact element I'm trying to detect. The element is not occluded or scaled in any way, the lighting has not been changed, and the only differences are minimal <50 pixels changes in XY position and <30 deg changes in rotation. I have the matching settings set to 0-360 rotation and I have the search area set to full resolution of camera. The template is 1172x1134 pixels. The camera resolution is 2592x1944. I have tried taking the template and the inspection images in sharp focus and slightly out of focus to prevent features from being generated on the texture of the element I'm inspecting. Neither has helped. This seems to be an internal problem with NI Vision detector routines, I have absolutely no outside variables and no changes in light, scale, height, and focus, and I have seen SIFT algorithms work extremely well in completely bad conditions. Did anybody else have any of these issues? If I was to write a feature detector routine, I would have included an option for the detector to take the best possible guess if no exact match was found and report the score back to user, and let the user decide whether to use the result. Can something like this be done with Geometric Matching?

Unfortunately I can't post any code or images due to project restrictions, 

Versions Labview 2011 SP1, NI Vision 2011, Vision Assistant 2011 SP1

 

Thanks,

0 Kudos
Message 1 of 4
(2,718 Views)

I forgot to add that I checked all error wires but each reported "no error"

Thanks,

🙂

0 Kudos
Message 2 of 4
(2,713 Views)

I can't seem to edit my posts on NI forum.

I wanted to add that I created the VI from Vision assistant, so at the heart of my project is this VI, and I know the issues aren't caused by any additional functions in my code becasue I am I rand this exact VI and it still failed to detect a match.

 

Still lookin for help, Thanks.

0 Kudos
Message 3 of 4
(2,699 Views)

SOLUTION::

 

I found the source of the problem to be an inability of NI Vision to process geometric detection of large templates, (mine was 1000x1000 pixels from 2500x1900 camera resolution image).

This is probably due to a memory overflow or reached limit in feature count. My PC is a 32bit Windows 7 platform and has 3.5gB ram, this can perhaps be what causing the limitation. However, it could also be that the number of features in my image/template approached an internal limit within NI Vision.

 

My solution was

Including an IMAQ-Resample node with bilinear interpolation positioned right after the IMAQdx Snap. This effectively shrinks the captured image to a smaller resolution without cropping (mine was 1024x768). I also had to include that same node in Vision assistant before Geometric Matching in order to re-generate a new Pattern for 1 to 1 scale. Immediately the geometric detection began working 100% of the time.

 

Prior to this I ran a lot of tests and determined that the rotation of the actual part being inspected was the cause of misdetection. When the part was in certain orientation (I would like to say 95% of the time it was detected it was in 45 degree increments from 0 to 360 degrees, but 5% of the time it was detected at other rotations) the reported score was around 900, whereas my minimum detection score was set to 300. In any other orientation the match simply would not be found. I would like to post all my results, but again I can't because of privacy issues.

 


NI Vision programmers: I understand that memory allocation and data types for feature detection and recognition must be kept as small as possible in order for Geometric Matching to work as fast as it does, so perhaps attempting to match a 1000x1000 pattern is too much, even if machine process time allows for it. But unfortunately, no error was reported to me from Geometric Matching. It would be good to include some overflow error if this does occur. 

 

Thank you,

 

 

0 Kudos
Message 4 of 4
(2,696 Views)