From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -1074395628 IMAQ Learn Multiple Geometric Patterns

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


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 11 of 25
(4,156 Views)

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 

Download All
0 Kudos
Message 12 of 25
(4,155 Views)

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


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 13 of 25
(4,149 Views)

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

0 Kudos
Message 14 of 25
(4,147 Views)

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

Shazil M.
CLAD
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 15 of 25
(4,142 Views)

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 .Smiley Sad Please give me valuble suggestions.

 Thanking You

Regards

Shreya

0 Kudos
Message 16 of 25
(4,140 Views)

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):

 

test.png

 

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


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 17 of 25
(4,130 Views)

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

0 Kudos
Message 18 of 25
(4,115 Views)

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.

    

match 1 front panel.png

Thanking You

 

Regards

Shreya

 

0 Kudos
Message 19 of 25
(4,102 Views)

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,

Shazil M.
CLAD
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 20 of 25
(4,088 Views)