How to capture frames after each 5 seconds from live stream and save as image in a folder ??
1 回表示 (過去 30 日間)
古いコメントを表示
saeeda saher
2019 年 1 月 28 日
回答済み: Balakrishnan Rajan
2019 年 1 月 30 日
I am trying to save frames from live stream after each 5 seconds duration and save the frames as an image into the folder. Kindly tell me how to define the n number of frames of live stream cam here?
Please help me to solve this problem.
Folder = 'OUTPUT\';
vid = videoinput('winvideo', 1);
% wait for 5 seconds
for iframe = 1
frames = getsnapshot(vid);
pause(5);
imwrite(frames, fullfile(Folder, sprintf('%06d.jpg', iframe)));
end
0 件のコメント
採用された回答
Balakrishnan Rajan
2019 年 1 月 30 日
You can use a while loop here.
Folder = 'OUTPUT\';
vid = videoinput('winvideo', 1);
% wait for 5 seconds
while true
frames = getsnapshot(vid);
pause(5);
imwrite(frames, fullfile(Folder, sprintf('%06d.jpg', iframe)));
iframe = iframe + 1;
end
Hope this does it.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!