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 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!