필터 지우기
필터 지우기

How can I do the same task with a loop in the step function?

조회 수: 3 (최근 30일)
kassem EL KEBBAR
kassem EL KEBBAR 2017년 5월 31일
답변: Image Analyst 2017년 6월 1일
Hello,
Please can anyone help me how can i correct this? I want to repeat taking pictures of the face detected, every 3 seconds, and save it in a file. (NB: the for..end is just for the video reader). Thank you.
for taoefaeffadef = 1:100
videoFrame = step(videoFileReader);
matchPic = imcropPolygon(bboxPolygon,videoFrame);
matchPic = cutPic(matchPic);
imwrite(matchPic,'test2.jpg');
....
end

답변 (1개)

Image Analyst
Image Analyst 2017년 6월 1일
I'm not sure what you're asking. If you want to take snapshots every 3 seconds and save to files on disk, then put this in the loop:
thisImage = getsnapshot();
filename = sprintf('Image %d.png', taoefaeffadef); % Change filename at each iteration.
imwrite(thisImage, filename); % Save to disk.
pause(3); % Wait 3 seconds

카테고리

Help CenterFile Exchange에서 Manage Products에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by