10-20-2009 05:44 AM
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
10-20-2009 06:09 AM
So you need to create the template only once right?
10-21-2009 01:56 AM
Hi,
I need to create new template images.
cheers
-Adam
10-21-2009 03:06 PM
Hello,
Have you tried using Vision Assistant to generate the LabVIEW code in order to troubleshoot what is different between the two?
-Zach
10-21-2009 11:55 PM
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
10-22-2009 01:54 PM
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
10-25-2009 12:25 AM
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
10-26-2009 09:47 AM
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
10-27-2009 07:51 AM
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
10-27-2009 09:59 AM
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