ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Color Match Results

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?

 

 

Download All
0 Kudos
Message 1 of 2
(4,903 Views)

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...

 

Example_VI_BD.png

 

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


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 2 of 2
(4,892 Views)