필터 지우기
필터 지우기

how to make a live video from webcam to appear on the fig file which i have created

조회 수: 2 (최근 30일)
how to make a live video from webcam to appear on the fig file which i have created

채택된 답변

Stephen
Stephen 2012년 5월 4일
You may try these.
clear all;
imaqmem(80000000) ;
aviobj = avifile('myavifile6');
aviobj.quality = 100;
vid = videoinput('winvideo',1,'YUY2_640x480');
set(vid,'returnedcolorspace','rgb');
set(vid,'framespertrigger',inf);
set(vid,'timerperiod',1);
set(vid,'timeout',500);
set(vid, 'DiskLogger',aviobj);
set(vid,'loggingmode','disk');
vidRes = get(vid, 'VideoResolution');
nBands = get(vid, 'NumberOfBands');
subplot(1,2,1);hImage = imshow( zeros(vidRes(2), vidRes(1), nBands),'InitialMagnification',100' );
preview(vid,hImage);
start(vid)
while(1)
frame = getsnapshot(vid);
subplot(1,2,2);imshow(frame,'InitialMagnification',100');
Ha_ax=gca;
str = get(gcf,'currentkey');
if strcmp(str,'space')
break;
else
continue;
end
end
stop(vid);
aviobj =close(aviobj );
  댓글 수: 7
mahendra kumar
mahendra kumar 2012년 5월 6일
sir, do u know how to draw a bound box on the live video which is been capturing, as i m doing a face detection project, so i need to detect the face in the video and draw a bound box around it..i hav the code to detect the face from the frame, which i capture from the video,but i want to do the face detection on the live video itself.can u plz help me
Stephen
Stephen 2012년 5월 6일
seems that you can get some hints from the moving-detection code,which is easy to be found on the internet

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by