Azzera filtri
Azzera filtri

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

3 visualizzazioni (ultimi 30 giorni)
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

Risposte (1)

Image Analyst
Image Analyst il 1 Giu 2017
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

Categorie

Scopri di più su Manage Products 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!

Translated by