LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save frame when pressing the button

Solved!
Go to solution

Helo,

I'm acquiring a .avi video from a webcam and I'd like to save a frame of this video whenever I press an 'acquire button'. I'd like also to save the acquired frame in separate files (for example, frame 1 in image1.png file, frame 2 in image2.png file and so on).

Any suggestion?

 

Thanks!

0 Kudos
Message 1 of 16
(3,415 Views)

Elena,

 

do you have NI Vision Acquisition?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 16
(3,402 Views)

yes I do

0 Kudos
Message 3 of 16
(3,390 Views)

Then verify that you have access to the Vision Development Module. This gives you specific functions for AVI.

 

I think this should provide you with all requested functions.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 16
(3,387 Views)

this is the first attempt (see attachment) , but I don't know how to 'grab' the frame, this confiuration gave error while running when I press the 'acquire' button

0 Kudos
Message 5 of 16
(3,384 Views)

Never worked with the assistant (blue expressVI) so i am not sure what the source of error could be in specific.

The basic functions you require are in the AVI palette as well as in the IMAQ or IMAQdx palette, depending on the camera you are using. Both supply a "grab" function.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 16
(3,380 Views)

The express take the images from the webcam, that is it. I try the 'grab' but it says that 'NI-IMAQ:  The passed in interface or session is invalid' .. how can I pass it correctly?

0 Kudos
Message 7 of 16
(3,378 Views)

Hm, working with screenshots on code is rather difficult. It seems to me that you are using an additional "Grab Acquire" which is definetly not correct if the express VI already returns a proper image from the camera......

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 8 of 16
(3,374 Views)

Now I can see the frame when I acquired it but I can't save it 'File access denied' .. any idea ? (see attachment)

0 Kudos
Message 9 of 16
(3,355 Views)

Well, your filepath constant for the IMAQ Write File 2 function contains an invalid path since it does not point to any file on disk. A file path to disk is always absolut, so it has to contain e.g. a file letter (like "C:\").

 

Another thing you have to consider is that you are going to use the same file for all images, simply overwriting previous ones. I doubt that this is the feature you are looking for....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 10 of 16
(3,342 Views)