Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Vision Unable to read data.

This project is to match multiple templates, then i copied the method from the example "Match Multiple Geometric Pattens", but the error says:

Error -1074395989 occurred at IMAQ ReadImageAndVisionInfo

Possible reason(s):

IMAQ Vision: Unable to read data.

The problem is that the programming works if I use the labview example's templates. However,when i use the templates which generated by myself, the error appears. I have checked the format and pixels of my generated template, which looks indentical to the example's template.

Could anybody help me to figure this out? I have attached my docs below.

Thanks.

Dylan

0 Kudos
Message 1 of 8
(6,199 Views)
First, I'm really sorry your code looks like complex(mess), please clean up...

Coming back to your problem-can you tell how you created templates?
Thanks
uday
0 Kudos
Message 2 of 8
(6,182 Views)

Hello,

 

it seems that you did not correctly create the templates. There is no Vision info present in your case.

If you reaplace the "IMAQ Read Image and Vision Info" with "IMAQ ReadFile" you will get no error (but then, you will not be able to perform the matching). You can check if there is any Vision info present using "IMAQ Is Vision Info Present".

 

You need to properly "train" the templates in order to make your application work.

 

Also, I second udka's suggestion - you should clean your code (not for the sake of us, but for your traceability and readabiltiy later on). Try using subvi's and remember dataflow.

 

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 8
(6,176 Views)

Hi Uday

Very appreiciate for your reply. Let me appologize of my messy code firstly, this is my first time to use labview to deal with my project, I am learning how to tidy up the code now.

I generated my template by simply screen shot, and then edit it to black-and-white format and 170*170 pixel, which is same as the templates given by labview example. 

 

Regards,

Dylan

0 Kudos
Message 4 of 8
(6,172 Views)

Hey Klemen,

Can you explain more of "No vision info"? I am a new to labview. What kind of Vision Info are required by labview?

I am so sorry about my messy code, I am learning to tide up my code now. 

Very appreciate for your reply! Thank you!

Regards,

Dylan

0 Kudos
Message 5 of 8
(6,171 Views)

Hello,

 

Labview Geometric matching uses a set of features/descriptors to describe the meaningful information contained in an image. You need to extract these descriptors to permorm the matching.

 

Here is an example on how to create the pattern matching templates in Labview (you can alternatively use the Template Editor utility):

 

http://forums.ni.com/t5/Machine-Vision/In-Pattern-matching-angle-remains-Zero-even-if-the-rotated/m-...

 

(see the attachment in the solution post). You can easily adapt this to learn geometric template (just modify/replace the relevant vi.'s).

 

Don't use screen shots to create the templates. Create a template directly from the image.

 

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 6 of 8
(6,161 Views)

Thank you Klemen,

The problem is finally solved!! Very appreciate your help!

Regards,

Dylan

0 Kudos
Message 7 of 8
(6,149 Views)

How did u solve the problem exactly and why you used aVI FILE PATH to try to track it and not a template

0 Kudos
Message 8 of 8
(5,864 Views)