Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
kassem EL KEBBAR
kassem EL KEBBAR le 31 Mai 2017
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

Réponses (1)

Image Analyst
Image Analyst le 1 Juin 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

Catégories

En savoir plus sur Manage Products dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by