Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to capture video in Octave?

Tags:

video

octave

Is there a native way to capture video in Octave?

In Matlab I'm used to use following (also maybe useful for other people):

a = imaqhwinfo('linuxvideo',1)  # or "imaqhwinfo('winvideo',1)" in Windows
a.SupportedFormats              # check supported formats
vid = videoinput('linuxvideo', 1, 'YUYV_640x480'); # open video stream with one of supported formats

start(vid);                     # start processing video
preview(vid);                   # open preview window

pics = cell(1,20)               # create array to store images from video
for i = 1:20                    
   pause(1);                    # every 1 second ...
   pics{i} = getsnapshot(vid);  # get video frame and save into corresponding position in array
end

But in Octave none of video related functions work. It is also possible to use Octave bindings for OpenCV to capture video, but I'm primarily looking for more pure and portable way.

like image 915
ffriend Avatar asked Jan 27 '13 21:01

ffriend


1 Answers

Install and load image-acquisition package. For more information, read the Wiki: http://wiki.octave.org/Image_acquisition_package

like image 144
Markus Avatar answered Sep 22 '22 11:09

Markus