Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Error:IMAQ Learn Pattern:the template image is too small

I am trying to create a program that automatically searches for a predetermined pattern and locates the pattern in the searched image (so I use 2 images). Therefore I downloaded the Pattern Matching Example.vi from Ni.com and try to modify it to remember a certain pattern extracted from pattern.bmp. so that the user do not need to draw a rectangle and select ROI every time he runs the program. I run Pattern Matching Example.vi to find a constant of the ROI of the part that I want it to be the pattern. I get the ROI constant from the ROI descriptor indicator on the front panel of Pattern Matching Example.vi. Then I put that ROI constant into Pattern Matching Example-test.vi (the modified code) (I put it in the diag
ram, connecting to Unbundle). But I get the error at the IMAQ Learn Pattern (in Matching Example-test.vi) that "the template image is too small". Although, the ROI and the template image (pattern.bmp) used is the same when I run both Pattern Matching Example.vi and Pattern Matching Example-test.vi, the Pattern Matching Example.vi doesn't have any error at the IMAQ Learn Pattern, while Pattern Matching Example-test.vi does. What was wrong with Pattern Matching Example-test.vi?
0 Kudos
Message 1 of 2
(3,484 Views)
Irene,

I tried out your program, and didn't have any problems. The ROI you defined was pretty large, so it took a while for it to train. That could be your problem. I didn't see any problems with the way you set it up, though.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 2
(3,484 Views)