10-07-2014 07:30 AM
Dear Forum
I'm puzzled by the behavior of my pattern matching application.
on the attached pictures you will find an ill pattern match
the pattern to match is displayed in the small window. On the large image the search area is defined in green.
My expected behavior would be "No match" but what I see is a match outside the search area! ( to get a good result, I should allow rotation of the pattern but this is not the point here)
Is this behavior consistant with "Imaq match pattern 2"? Itook it as a starting point that the entire template should be found in the search area.
Am I wrong or is there another flaw in my vi which could explain this?
best regards
PF
10-07-2014 11:17 AM
It is getting the best match it can given the options you gave it. It is matching the brightest circle in the template with the brightest circle in the image. This score is high enough to qualify as a match, apparently.
Bruce
10-07-2014 11:43 AM
10-07-2014 03:56 PM
That's a good question. I am pretty sure the search is constrained within the ROI, so that does seem like an unusual result. They might have changed the rules for this version of search, or maybe I am remembering wrong.
Bruce
10-08-2014 09:34 AM - edited 10-08-2014 09:35 AM
Hi Pif
I don´t know if this matches your case because I miss some information, but take a look at this.
Common Errors and Issues When Using Pattern Matching with NI Vision (Some Matches Lie Outside A Rotated ROI When Doing Pattern Matching)
http://digital.ni.com/public.nsf/allkb/F05924D50AD6472B86256F320075CDBF#MatchesOutsideRO
If that isn´t the case, can you upload your VI and your picture?
Regards
Kilian H.
Applications Engineering
National Instruments
10-08-2014 09:57 AM - edited 10-08-2014 09:57 AM
thank you Kilian
I don't think this apply to my problem, I'have a non rotated rectangle for the search zone.
I will run some test tomorrow to check exactly what's in my wires when such a strange behavior occurs!
Best regards
PF
10-10-2014 04:00 AM - edited 10-10-2014 04:01 AM
Hi
Back after some testing.
Indeed it had to do with the optional rectangle (search zone). I was wiring a 5 elements array with a 0 for the fifth element (rectangle with a 0° rotation directly converted from cluster to array).
Removing this fifth element was all I needed to do to have a working VI!
Apparently the optional rectangle input of Imaq Match Pattern 2 should be strictly 4 elements.
Thank you for your help, have a nice day
PF