PDA

View Full Version : Labview: Saving picture to *.bmp



Tristan
September 13, 2004, 12:57:16
Can someone help me out with that, i already figured out how i can grab the picture from livestream and display it on the frontpanel, but can't figure out how to save the picture.

Can someone mail me a subvi that can save files to *.bmp using saveimagesequence or help in a other way

the second problem i'm facing is that i want every *.bmp having the sampe resolution so for example every picture have to be 1024*786 and don't got to change if i switch the video format.

my email is tristandoornebosch@hotmail.com

tnx alot

Tristan

Tim Cassens
September 13, 2004, 15:11:01
Hello,

to call IC Imaging Control functions like MemorySaveImage from LabVIEW, you have to use an Invoke Node VI.

Call MemorySnapImage and then MemorySaveImage to save Bitmap Images.

The image files will always have the current live video format, there is no way to change that.

Another possibility would be, if you grabbed an LabVIEW Picture, use the VIs that come with LabVIEW to save the Picture.

Use the Picture-To-Pixmap VI and then the Write-JPEG-File VI to write for example JPEG images.

Best regards
Tim

Tristan
September 13, 2004, 16:35:57
I got that working now.. both ways with the invoke notes and with the labview vi.

But what if i want to save a whole sequence for example 20 pictures, how do i do that? I think i have to use SaveImageSequence invoke node but can't seem to figure out what is wrong if i use this method.

MemorySnapImageSequence and then MemorySaveImageSequence then i have to specify the Imagecount and SequenceLength and the filename

ImageCount and SequenceLength i'm using a "long constant" and for filename just a control string with the following path in it "c:\figure*.bmp" and if i run the program it gives me the following error out:

code: -2147024809
source: Execepion occured in IC.ICImagingControl.1, Invalid argyment passed to function in IC_Save_Picture.vi->Device Setup.vi

I think it has to do with the filename because MemorySnapImageSequence it goes true correct but MemorySaveImageSequence gives this error.

I'm sorry i'm not yet that experienced with labview.

Tnx alot Tristan

Stefan Geissler
September 14, 2004, 10:34:20
Hello Tristan,

To snap more than 5 images, you must set the ImageRingBufferSize property of IC Imaging Control to the desired value. Therefore insert a Property Node into your VI. Please remark, that the ImageRingBufferSize property can only be set, if the live video is not running.

Tristan
September 16, 2004, 12:19:03
Could you explain it a litle more Stefan the structure should look like this?

LiveStop --> ImageRingBufferSize --> MemorySnapImageSequence --> MemorySaveImageSequence

and ImageRingsize = 100 same as image count and sequence length ?

I got it sort of working.. but the problem is it saves all the pictures after eachother so i end up having 100 pictures in a minute or something. How can i make it work so it waits before making the next picture? For example if a user pushes a button it creates the next picture?

Stefan Geissler
September 16, 2004, 12:33:24
Tristan,

Yes, you are are right. I have attached an image, showing my VI.

Tristan
September 16, 2004, 12:50:40
Ok but how do i fix that second problem so it saves 1 picture and then waits until i push a buton and does the secon picture?

i tried it with LiveCapturePause but it doesn't seem to work

Stefan Geissler
September 16, 2004, 13:52:56
Tristan,

There is a sample VI, that saves an image on a button click. If you save images on a button click, you do not need a big ringbuffer size.
To change the filename of each image to be saved, you must create the file using a counter in your VI.

Resizing of images, e.g 640*480 to 1024*768 will not be done be IC Imaging Control. Therefore you need other libraries.