Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

color pattern matching

Hi every one!

 

I'm working in a project using a robotic arm with a webcamb  to identify objects. I have tree colors (red, green and blue) and 3 forms (cube, sphere, piramid), for a 9 objects total on a white table that I must classify in another table, but to do that I have to aquire XY coordinates IMAQ Pattern matching gives.

 

Two questions:

 

1. What do I have to consider when making a color-shape  template of each object? I'm making a 640x480 snap with my webcam and if I draw a ROI around an object, matching VI finds it, but if I programatically give the path for a previously saved template there ar no matches.

 

2. Do I have to make 2 separated matching operations (one for color and one for pattern in grayscale)? because as far as I can see, IMAQ Match color pattern VI, matches shape and manages ranges of rotation and size, so I'm using just one match operaion.

 

This is the first time I work vith NI-Vision, and I've been dealing with this for a while, but I feel I'm getting nowhere.

 

Theres my VI for you to take a look.

 

Thanks for your help!!

 

PD: As you can see, english is not my native languaje, so Spanish answers are more than welcome 😉

 

0 Kudos
Message 1 of 16
(5,436 Views)

mm sorry. three colors... not tree... 

0 Kudos
Message 2 of 16
(5,433 Views)

Hello smurillo,

 

could you please also provide some template images to test (and also a snapshot)?

 

Best regards,

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 3 of 16
(5,424 Views)

Hi K! (wasn't expecting a reply from MIB... my problem must be serious Smiley Very Happy )

 

Here is one of the templates. I created  them using Vision Assistant: 

1. open webcam

2. take a snap from the table where the objects are.

3. create a template by manually selecting a ROI around, in this specific case

4. save template as png

 

right now I don't have the snapshot, but I think the problem is in the template creation procedure. In a few hours i'll post the snapshot

 

thanks for your answer!

 

Best

 

0 Kudos
Message 4 of 16
(5,419 Views)

Hello,

 

please try to create the color templates with the attached vi.

 

You can use the second vi to search for the created template.

 

I hope this helps you.

 

Best regards,

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."
Message 5 of 16
(5,413 Views)

Hello K!

 

I created my templates with your VI... it worked with the green pyramid buy it also mathes with the green cube. I have to run some more tests and try  with the other geometric forms.

 

I'll be reporting my progress!!!

 

Thanks a lot...

0 Kudos
Message 6 of 16
(5,397 Views)

Hi K!

 

Well... I made my templates using your Vi, but when y started testing them with the other Vi you posted the problems started.

 

I got false-positive matches as you can see in the image attached.

 

I'm I doing something wrong? is there a way my templates can be more accurate?

 

Thanks!

 

0 Kudos
Message 7 of 16
(5,335 Views)

Missed the images!

 

And I forgot to tell the same thing happnes with the other figures and colors

 

best!

Sebastian

Download All
0 Kudos
Message 8 of 16
(5,334 Views)

Hello,

 

could you please also attach the image (the snapshot that is seen in the "print red pir err.png"). I will take a look. Also why do you specify 10 matches, if you know there are only two correct parts?

 

Maybe you could also try to find the matches in an 8-bit grayscale image for shape and then extract the color information of the detected match for color recognition. Than you can classify your parts correctly.

 

 

 

Best regards,

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 9 of 16
(5,327 Views)

Hi K!

 

in the picture you can see the objects I'm working with.

 

I made 12 templates for the different combination of colors and shapes (3*4) and the idea is to match them regardless if they are of different size or are rotated.

 

The image I posted in the other comment was just an example for you to see the problems I found, but the program must be capable to grow and not be limited to 2 or three matches; let's suppose I have to classify those 33 objects in 12 categories.

 

Do you really think is better to make matches in grayscale? In that case, is it better to do the templates with vision assistant? how do I extract the color info after that? with coordinates? 

 

Thank you!!!

0 Kudos
Message 10 of 16
(5,295 Views)