Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

imaq match pattern 2 and search area

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

 

PFreconnaissance2_position11.jpg

0 Kudos
Message 1 of 7
(4,886 Views)

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

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 7
(4,877 Views)
Thank you Bruce for your comment.
What I don't understand is that I'm restricting the search area to the green rectangle. Is it normal that the match pattern vi returns a match partially out of the search area?
If so I should add a test to make sure the result is inside my search zone! Best regards PF
0 Kudos
Message 3 of 7
(4,870 Views)

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

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 7
(4,866 Views)

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

0 Kudos
Message 5 of 7
(4,843 Views)

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

0 Kudos
Message 6 of 7
(4,839 Views)

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

 

0 Kudos
Message 7 of 7
(4,815 Views)