I don't know why you say you should not run the code many times. You need to run it for each person you want to take a snapshot of. I'd put all that stuff into the callback function of a button labeled "Snap and save picture..." then ask for the file name with uiputfile() and save it with imwrite(). Each time you want to snap a photo, click the button and run the code.
taking snapshot of many persons
1 次查看(过去 30 天)
显示 更早的评论
I have code below for taking snap shot of single person
close all
imaqhwinfo
dev_info=imaqhwinfo('winvideo',1)
%info=imaqhwinfo('winvideo')
celldisp(dev_info.SupportedFormats)
vid=videoinput('winvideo',1,'YUY2_320x240');
%Open Figure
hFigure=figure(1);
%set parameters for video
%Acquire only one frame each time
triggerconfig(vid,'Manual');
set(vid,'framespertrigger',1);
%Go on forever untill stopped
set(vid,'triggerrepeat',Inf);
%Get a grayscale image
set(vid,'ReturnedColorSpace','RGB');
start(vid);
preview(vid);
data = getsnapshot(vid);
imshow(data);
this codes take snapshot of single person,if i want to take snapshots for many perosons how to perform,.i should not run the code many times its not possible
is it possible to perform like pressing and key the other person snapshots will be taken?
assuming 10 persons are stanging in a queue,need hoe t take snapshots of all of them
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Acquisition Using Any Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!