 mpickel
		
			mpickel
		
		
		
		
		
		
		
		
	
			02-28-2014 03:14 AM
I have written the following code around the Match Pattern algorithm.  
For my template item I am using a modified "block" of red that I made in paint, and I put my red tshirt in front of the camera and got no matches.  Even when setting the match miniuim score to 200.  I also set the minuim matches to 1 due to the oversizeness of the shirt.  And still got no matches.  I have in cluded the code the an image of the shirt and also the red block that I am using as a template image, suggestions?
The shirt is pretty red, Lightning is throwing it off, but contrast is set low, should I get a different camera?
 Klemen
		
			Klemen
		
		
		
		
		
		
		
		
	
			02-28-2014 04:07 AM
Hello,
first of all, did you "learn" the color template? Looking at your image "test.png" is see that there is no Vision Info present...
Second, looking at your image and the template, I doubt you will get any good results. Why do you not create the template from the real object instead of doing this in paint?
Take a look at here for example:
http://forums.ni.com/t5/Machine-Vision/match-pattern/m-p/2747988#M41308
P.S. Do you really need color matching? Is your object always (uniformly) red? You can extract the green plane from your image in this case and acquire a good contrast between the background (depends on the bacground) and the object of interest.
Best reagards,
K