how can i feed the pre-recorded video to the following code instead of live video(from webcam)/ or how can i save the live video in a 'disk'
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Greeting to the community, I am using matlab for image processing. anybody knows that how can i feed a pre-recorded video to the following code instead of live video(from webcam)?
I need to input pre-recroded video, or using live video but save the video in a folder first (using 'disk' instaed of 'memory') before proceeding the next stage (image processing).
a part of the code:
% Select video format
hws = imaqhwinfo ;
hw = imaqhwinfo(hws.InstalledAdaptors{end},1) ;
VideoFormat = hw.SupportedFormats;
% Select video format
hws = imaqhwinfo ;
hw = imaqhwinfo(hws.InstalledAdaptors{end},1) ;
VideoFormat = hw.SupportedFormats;
set(handles.text_vf, 'String', ['Video Format : ', 'YUY2_640x480']);
% set videoinput object
video = videoinput('winvideo',1,'YUY2_640x480');
set(video,'FramesPerTrigger',10);
set(video,'ReturnedColorSpace','grayscale');
set(video,'LoggingMode','memory');
triggerconfig(video,'immediate');
set(video,'FramesAcquiredFcnCount', 3);
set(video,'FramesAcquiredFcn', {@FramesAcquiredFcn,hObject});
% Preview UPDATE
vidRes = get(video, 'VideoResolution');
vidWin = image(zeros(vidRes(2), vidRes(1)),'Parent',handles.Preview);
preview(video,vidWin);
0 Commenti
Risposte (1)
Mohammad Sami
il 4 Set 2020
You can use the VideoReader to read a video file.
v = VideoReader('xylophone.mp4');
while hasFrame(v)
frame = readFrame(v);
end
2 Commenti
Mohammad Sami
il 5 Set 2020
Video reader class does any property video Resolution. If you want resolution you will have to get Height and width properties.
Documentation of video reader is available here
https://www.mathworks.com/help/matlab/ref/videoreader.html
Vedere anche
Categorie
Scopri di più su Image Acquisition Support Packages for Hardware Adaptors (Generic Video Interface) in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!