How to capture frames from video and display & compare those frames to detect edge detection ??
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi all,
I am new to MATLAB and want to capture video continuously and from that i want some frames to compare and want to detect the edge but i am not able to do this because when i ws capturing the video at that same time the video trigger can not increses it's value .
It is possible to capture the images or frames from video that is actually snapshot and display that snapshot or plot the different frames in one plot with the use of subplot ??
here is the code which i m trying and go into infinite loop. please help me out with this.
clc; clear; close all; vid = videoinput('winvideo'); preview(vid); get(vid); start(vid); while(vid.FramesAcquired<=10) vid.FramesPerTrigger = 9; vid.ReturnedColorspace = 'grayscale'; img1=getdata(vid); subplot(2,1,1); imshow(img1); set(gcf, 'Position', get(0,'Screensize')); img2= fullfile(pwd, 'try1.jpg'); imwrite(img1,img2); subplot(2,1,2); imshow(img2); frm1=getsnapshot(vid); pause(2); frm2=getsnapshot(vid); subplot(2,2,1); imshow(frm1); subplot(2,2,2); imshow(frm2); end delete(img2);
댓글 수: 0
채택된 답변
Image Analyst
2013년 10월 28일
Use your own counter instead of vid.FramesAcquired.
댓글 수: 2
Image Analyst
2013년 10월 28일
numberOfFramesProcessed = 0;
while numberOfFramesProcessed <= 10
% Your code goes here. Then increment:
numberOfFramesProcessed = numberOfFramesProcessed + 1;
end
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!