how can i extract all frame and logged to disk from an given input video(webcam)
4 ビュー (過去 30 日間)
古いコメントを表示
%-Start
vidFormat = 'YUY2_320x240';
vid=videoinput('winvideo',1,vidFormat);
triggerconfig(vid,'manual');
set(vid,'FramesPerTrigger',1);
set(vid,'TriggerRepeat', Inf);
set(vid,'ReturnedColorspace','rgb');
start(vid);
for k=1:5
trigger(vid);
im= getdata(vid,1);
imshow(im);
end
stop(vid),delete(vid),clear vid;
0 件のコメント
回答 (1 件)
Walter Roberson
2012 年 5 月 11 日
You probably will not be able to record all frames to disk. The frame rate for 320 x 240 is usually fairly high (often 60 frames per second), which is probably faster than you can record, and is certainly faster than you can write to disk.
If you were to restrict the time sampled over to a small number of seconds, then you could potentially record the frames in memory and then write the frames to disk after the sampling time is over.
There are a number of ways to write individual frames to disk. The method you use will depend on how you want to process the frames afterwards.
1 件のコメント
Mohd Aquib
2013 年 5 月 23 日
編集済み: Mohd Aquib
2013 年 5 月 23 日
hi walter m facing the same pblm...i need to extact all the frames(memory) and store it to a particular folder...so what i shd do..code is as follows
vid = videoinput('winvideo',1);
preview(vid);
set(vid,'TriggerRepeat',Inf);
set(vid,'ReturnedColorSpace','grayscale');
vid.FrameGrabInterval = 1;
% Set value of a video source object property. vid_src = getselectedsource(vid);
set(vid_src,'Tag','motion detection setup');
disp(sprintf(' FRAMING START from VIDEO'));
start(vid);
while(vid.FramesAcquired<=50) % Stop after 100 frames
data = getdata(vid,2);
diff_im = imabsdiff(data(:,:,:,1),data(:,:,:,2));
imshow(diff_im);
end
}
for making a folder and storing frames(from memory) to this folder
m tring this code between the above code but these errors r found
1) permission is denied for MKDIR 2) undefined function fullfile..
outputFolder = fullfile(cd, 'Test');
if ~exist(outputFolder, 'dir')
mkdir(outputFolder);
end
outputBaseFileName = disp('Image %3.3d.jpg',vid);
disp(outputBaseFileName);
outputFullFileName = fullfile(outputFolder, outputBaseFileName);
m in trouble plz help so dat i cd store these frame to a folder
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!