LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save a frame of a video?

Solved!
Go to solution

Hi! I have a VI from a camara that allows you to see the video image. I have modified it so you can freeze the image and I want to save this image to a file. I have looked into the forum answers and try everything suggested and I don't understand why the code is not working.

I have an array with pixels with their intensities and I have converted it with flatten pixmap VI and then I am using a write jpeg file VI.

When you run the program everything seem to be working. You also see a promp screen to choose the location of your file (although it ask you were is your file to write, as it was trying to rewrite the file, not creating a new one) but then, the file does not appears anywhere.

Picture1.png

Can you please help me?

Thank you very much.

0 Kudos
Message 1 of 8
(5,759 Views)

when pop up asks do you give any file name? and every time different?

-In image we can't see how and why it is not working, Post vi.

Thanks
uday
0 Kudos
Message 2 of 8
(5,754 Views)

Dear udka,

The pop up asks to give a name, it is the same pop up every time. I am attaching the VI to this message.

Thank you very much

0 Kudos
Message 3 of 8
(5,727 Views)

When pop up asks for file name, did you give file name and path correctly?

 

Thanks
uday
Message 4 of 8
(5,718 Views)

I am not sure about what you mean by "correct file name", I am sending the image of the promp I get.

Thank you for your answer.

Picture2.png

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

-Please create path and errout out indicator to Write JPEG File VI and see if what path the vi saves file.

-Are you getting any error pop up after this?

-Could you confirm the array and image data you are sending are non empty?

-So you are giving test1.jpg as file name and path to desktop am i right?

-In desktop you don't have any file with the name test1 ?

Thanks
uday
Message 6 of 8
(5,711 Views)

I have created the path an error out indicators.

I get an error "C:\Program Files (x86)\National Instruments\LabVIEW 2011\vi.lib\picture\jpeg.llb\Check Color Table Size.vi" but I don't know what this means. The image frozes and it seems not to be an empty image, but I am not sure.

In desktop I don't have any file with the same name as the file I want to write.

Thank you.

Picture3.png

0 Kudos
Message 7 of 8
(5,707 Views)
Solution
Accepted by topic author Laurawendy

The problem is at colors input to Flatten Pixmap.

-Create a for loop with N=256.

-Use  RGB to color vi http://zone.ni.com/reference/en-XX/help/371361M-01/lvpict/rgb_to_color/

-Connect i to all R,G,B terminals.

-Get the Output color indexed to for loop and connect the Array of Colors to colors input of Flatten Pixmap.

Thanks
uday
Message 8 of 8
(5,696 Views)