10-30-2014 02:18 AM
Hello,
i did not download your code, but the invalid image type arises due to the U32 camera image. You need to cast the image to U8 after the acquisition or extract a specific color plane (I would say intensity in your case).
So:
1. Change "image1" to U32 type
2. Create a new image reference and use type U8
3. Use IMAQ cast image after the image grab.
Best regards,
K
10-30-2014 03:21 AM
Respected Sir,
As suggested by you , I used extractsingle color plane VI and then run the VI .The error which I was getting earlier is removed but Geometric matching is not happening.
I am attaching snapshot of front panel and block diagram. Please suggest me the necessary modifications in my VI.
Thanking You
Regards
Shreya
10-30-2014 04:53 AM
Hello,
have you tried enabling "scale" and "occlusion"?
Additionally, you would probably have more accurate detection if you calibrate the camera for perspective distortion. Or try to keep the camera as perpendicular as possible to the working plane.
Can you attach an image of your three bolts (the image with resolution 2046x1080)?
Best regards,
K
10-30-2014 05:07 AM
Respected Sir,
My camera is already perpendicular to the plane of the object . I am attaching the image of 3 boltsas requested by you.
I have one doubt as I want to recorgnize a bolt should I use IMAQ detect shape VI to detect circular shape of the bolt or go for Geometric matching.?
I am using IMAQ match geometric pattern 2 VI is it right for the task? .Please give necessary solutions as soon as possible.
Thanking You
Regards
Shreya
10-30-2014 05:51 AM
Hi Shreya111,
It seems that you are using the right VI for the task. the IMAQ match geometric pattern 2 VI seems like it is doing what you require?
http://zone.ni.com/reference/en-XX/help/370281M-01/imaqvision/imaq_match_geometric_pattern_2/#Detail...
As per the manual above, this should be fine.
However, the IMAQ detect shape vi, does not seem like it will be able to deal well with hexagonal shape (as per the manual)
http://zone.ni.com/reference/en-XX/help/370281M-01/imaqvision/imaq_detect_shapes/#IMAQDetectEllipses
So what you are using is alright.
Let me know if this resolves your issue.
Best Regards,
Shazil M.
Applications Engineer
National Instruments UK & Ireland
10-30-2014 06:40 AM
Respected Sir,
I am attaching my vi. It shows one match at instance. When I run again it shows zero matches. I changed match score again and again but didn't succedd . Please give me valuble suggestions.
Thanking You
Regards
Shreya
10-30-2014 07:51 AM - edited 10-30-2014 07:55 AM
Hello,
first of all I would like to correct myself in the previous post - I wrote bolts, but in fact the objects you are trying to detect are nuts.
Second, I have tried to detect all three nuts with one template, but it seems this will be difficult to achieve with the current setup. Can you possibly try using a white background with the lighting in the direction of the camera and see what images you get?
If I use three different templates, all three objects get detected with excellent scores (which is to be expected, since the template images were extracted from the image below):
For the template learning phase I changed only scale (50 - 150%) and rotation parameters (0-360°) - other parameters remained default. In this case it won't matter since the templates are extracted from the image above. But for the other positions of the nuts/camera, the parameters are important.
Best regards,
K
10-30-2014 11:59 PM
Respected Sir,
Can you please elobrate how you design your code by using three templates. Also, the template I am using is perfect or not.?Plese give me favorable suggestions as soon as possible.
I am attaching the template.
Thanking You
Regards
Shreya
10-31-2014 05:13 AM
Respected Sir,
I tried using white background and succed in matching one nut . Please help me how I modify my code so as I will be able to recognize three nuts by using three templates.
I am attaching my vi and its respected snapshots.Please reply soon as possible.
Thanking You
Regards
Shreya
10-31-2014 10:40 AM
Hi shreya111,
Have you managed to solve this issue yet? Did you try the recommendation mentioned above of using 3 different templates instead? I understand that you have been able to use the white background successfully.
Do let me know how you get along with this.
Best Regards,