07-21-2013 03:06 PM
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 😉
07-21-2013 04:58 PM
mm sorry. three colors... not tree...
07-22-2013 01:42 AM - edited 07-22-2013 01:43 AM
Hello smurillo,
could you please also provide some template images to test (and also a snapshot)?
Best regards,
K
07-22-2013 02:25 AM
Hi K! (wasn't expecting a reply from MIB... my problem must be serious )
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
07-22-2013 03:36 AM
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
07-24-2013 04:56 PM
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...
08-01-2013 02:31 AM
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!
08-01-2013 02:35 AM
Missed the images!
And I forgot to tell the same thing happnes with the other figures and colors
best!
Sebastian
08-01-2013 02:55 AM - edited 08-01-2013 02:56 AM
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
08-05-2013 06:20 PM
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!!!