Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

golden template

Hi all,

 

I am having troubles saving a image from a USB web cam for use as a golden template in labVIEW 2009.

 

i have reviewed this thread: http://forums.ni.com/ni/board/message?board.id=170&message.id=288619&requireLogin=False as well as the "label" example but i am unable to get it working.

 

I believe this is a quick fix as i have it all working properly in LabVIEW Vision Assistant however i am unable to save a new template image outside of Vision Assistant.

 

I am attempting to create a machine vsion safety system that simply compares a freshly taken image to a template image and attempts to locate differences, i have attached my VI .

 

Any assistance would be much apreciated.

 

thanks in advance

Adam

 

 

0 Kudos
Message 1 of 15
(4,929 Views)

 


am attempting to create a machine vsion safety system that simply compares a freshly taken image to a template image and attempts to locate differences, i have attached my VI .

 

So you need to create the template only once right?

0 Kudos
Message 2 of 15
(4,927 Views)

Hi,

 

I need to create new template images.

 

cheers

-Adam

0 Kudos
Message 3 of 15
(4,905 Views)

Hello,

 

Have you tried using Vision Assistant to generate the LabVIEW code in order to troubleshoot what is different between the two?

 

-Zach

0 Kudos
Message 4 of 15
(4,895 Views)

Hi Zach,

 

yes the template file i assign in Vision assistant works properly

 

i think i should clarify the question:

 

How would i prepare and save an image acquired via USB Web cam for use as the template image in a golden template comparison?

 

-Adam

0 Kudos
Message 5 of 15
(4,882 Views)

Hello,

 

I would take a look at this example: http://zone.ni.com/devzone/cda/epd/p/id/5556

The difference between what you are doing and this one is that it reads the template image from a file at the beginning and uses the same one each time. If you wanted to acquire an image from a camera, you would modify the code to have your acquisition give the input to the IMAQ Learn Golden Template each time  you acquire a new one. After this function, you can then do the IMAQ Compare Golden Template etc.

 

-Zach

0 Kudos
Message 6 of 15
(4,866 Views)

Hi Zach,

 

I have begun to modify the label reading example as per your instructions and i am at the stage of simply trying take an input from the webcam and to using a template that i defined(that i know works).

 

However it seems to just go the black on the output (no defects), also i am sure of the roll of the "defects" image that is enabled at the start of the VI. It's not giving any errors so i am usure of what the problem is. 

 

i have attached the VI for your consideration,

 

cheers

-Adam

0 Kudos
Message 7 of 15
(4,841 Views)

Hello,

 

Since you are using a file as your template image, did you go into the Template Editor and save the file as a template? Also, if you save the image from your webcam as a file and then use the example to compare the images, do you get the same result you are getting now?

 

-Zach

0 Kudos
Message 8 of 15
(4,818 Views)

Hi Zach,

 

Thanks for your reply

 

Yes the it all works when using a file that has been learnt using the template editor. My problem lies in capturing, preparing and saving a template image from within labview.

 

I have created a VI(attached) to specifically do this based on what has been said in this thread it executes correctly however, it is only capturing completely black images. I believe i have done all of the template preparation stages correctly however i am unsure as to why i am only capturing completely black images.

 

any assistance would be much appreciated.

 -Adam

0 Kudos
Message 9 of 15
(4,804 Views)

Hello,

 

Can you try changing your imade display to snapshot mode? This is done by right-clicking it on the front panel and then selecting Snapshot. Also, can you verify the image type that you are sending to the Compare Golden Template VI? This needs to be a U8 image if you look at the documentation for that function. If it is not, I would suggest using the IMAQ Cast function in order to conver it.

 

-Zach

0 Kudos
Message 10 of 15
(4,798 Views)