Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does imaqMatchPattern function return "incompatible image size" error

I'm trying to do some pattern matching on a small LCD Display on a phone. I separate the display into 6 equal Regions of Interest, then try a match a template image in each of the regions. If I vary the template image size, the imaqMatchPattern function which is run as part of my MSVC++ application fails, returning "imcompatible image size".
When I run IMAQ Vision Builder stand alone,and test the template vs the LCD Display image, everything seems fine. Since the template image fits easily into the ROI, I get several matchs in each ROI.
0 Kudos
Message 1 of 2
(3,193 Views)
Hello,
In order for the pattern matching to operate correctly, the acquired image and the pattern template image must both have the same bit depth. For example, if you acquire 16-bit images but your pattern image is an 8-bit file, then you will get errors and will be unable to match the pattern to the image correctly.
If you cannot adjust your camera's bit representation but you have verified that your pattern image has a different bit resolution, then you can acquire a new pattern image file that matches the images being acquired.
Good luck with your application and have a good day!
Regards,
Koninika
Applications Engineering
National Instruments
http://www.ni.com/support
0 Kudos
Message 2 of 2
(3,193 Views)