12-15-2015 04:11 PM
Hi,
We have a we have a teststand step which calls a vision module, to perform an on-the-fly "patternchange" step. The labview code:
This works pretty good for a generic "patternchange" where we just want to see if the screen changes on the device under test, for synchronization purposes, not caring about what it changes from or to.
But this test seems to break down when the both the template and screen are black. What we are seeing in this case is that when pattern matching a black pattern to a black image, the pattern match fails, and thus our step falsely detects a "pattern change", when nothing changed at all (from black).
Is this a limitation in the pattern match tool? Should we not see a match when pattern matching a black template to a black image?
Thanks
David Jenkinson
12-16-2015 04:39 PM
David,
If your step falsely detects a change when you are matching a black pattern to a black image, does this mean that the match sometimes succeeds and will occasionally fail or are you changing what the pattern is throughout your program and this match fails when the first time you use this black pattern? If the second is true, how are you defing the ROI for this pattern? As weird as this sounds, would you also be able to provide a sample image and pattern and explain what the goal of this pattern match is?
12-17-2015 02:17 PM
Hi,
We have a step in teststand, which is called "sense pattern change". It calls a labview step module, what it does is:
1. Automatically acquire the current image from the display under test (via camera), whatever that image is, and use this as the template for subsequent pattern match loop
2. Loop continually acquiring additional images and pattern matching against template gathered in step 1, until the pattern match "fails" against the template acquired in step 1, thus sensing the pattern change.
This is basically what the step does.
The ROI is the entire image, so the size of the template image is in fact the exact size of the ROI in this case.
When there is content, and contrast, in the image content, this step works great and has for quite some time. We ran into this recently when we noticed the pattern change step was falsely returning too early, when the display under test had remained dark (and not changed). So I started digging deeper and probing/breakpointing the vi and noticed that a black image template fails a pattern match on black image (always btw), thus initiating this thread of whether this is accurate behavior.
So there is effectively no contrast to the template image or image trying to find a match with, I may have reached the limits of that pattern match algorithm(?)
Yes I can attach sample images, I'm trying to go a step further and replicating the behavior in vision assistant so I can post a nice packaged example. Trying to get to that today. Thanks
12-18-2015 01:35 PM - edited 12-18-2015 01:36 PM
Hi,
I wrote some notes how the NI algorithms work here..:
So Pattern Matching does depend on structural information, and yes, you are most likely right that the algorithm fails in your case (can't tell without sample pictures).
1) What is your true task: Are you trying to find the position of the pattern (Pattern Matching), or is the position constant / are you comparing it with something (Maybe "Golden Template" is better)?
2) Look at the template report output of IMAQ Learn Pattern - maybe the contrast value or similar already already detects a false black image and you can use that as a criterium for catching your edge case? Otherwise, a simple histogram would probably suffice to detect that case.
Birgit