Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

saving each frame

Hi

Using the sequence.vi from the examples of IMAQdx I'm able to acquire frames.The frames are saved in an array.How can I save each of those frames as an image?I'm using a DC210 CCD camera.

Thanks
Sukanya
0 Kudos
Message 1 of 5
(3,515 Views)
Hi Sukanya,

Thank you for posting on the National Instruments discussion forums.

There is another shipping example, Hardware Input and Output -> IMAQ -> File Input and Output -> Snap and Save to File.vi which demonstrates how to use the IMAQ Write File VI to save an image to disk.

You will want to combine these examples so that the Image Array is passed out of the Stacked Sequence structure and into a For Loop Structure. The Image Array tunnel into the For Loop should be Auto-Indexing, so that you can take each individual image and use the IMAQ Write File VI to write it to disk.

I hope this helps.  Please reply if you have any difficulty in combining these examples.  Thanks.


Rishee B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,491 Views)
Hi Rishee

I'm not too sure I understand how to go about that.If each frame has to be saved as a seperate image, how do I specify the filename?Also what are the elements that go into the for loop?Could you please elaborate on that?

Thanks,
Sukanya
0 Kudos
Message 3 of 5
(3,481 Views)
Hi Sukanya,

I have created a VI to demonstrate how to do this and attached a screenshot of it below.

The array of images is passed into a For Loop along with the image file path chosen by the user.  The VI then does some string manipulation to save the images to a series of files.  For instance, if the user selects 10 as the number of images, and C:\object.png as the path, the VI will save the first image to C:\object1.png, the second image to C:\object2.png, and so on until the last image is saved as C:\object10.png.

Please recreate this and let me know if it does what you are looking for.  I do not currently have an image acquisition board in my machine, so I was unable to test this code, but I'm fairly confident that it will work. 

Also, please reply if you have any questions about its operation.  Thanks.





Rishee B.
Applications Engineer
National Instruments


Message Edited by risheeb on 12-18-2007 10:49 AM

Message Edited by risheeb on 12-18-2007 10:50 AM
0 Kudos
Message 4 of 5
(3,452 Views)
Hi Sukanya,

I have attached the VI to this post in case you're unsure what some of the VI's in the screenshot I posted are.  This VI is saved for LabVIEW 8.0, so you will be able to open it in LabVIEW 8.0 or later.  If you have an older version than this, please let me know and I will try to save this for your version.  Thanks.


Rishee B.
Applications Engineer
National Instruments


Message Edited by risheeb on 12-18-2007 11:07 AM
0 Kudos
Message 5 of 5
(3,442 Views)