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.
Install and load image-acquisition package. For more information, read the Wiki: http://wiki.octave.org/Image_acquisition_package
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With