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);

採用された回答

Image Analyst
Image Analyst 2013 年 10 月 28 日
Use your own counter instead of vid.FramesAcquired.
  2 件のコメント
Jay Patel
Jay Patel 2013 年 10 月 28 日
can you help me with this i have tried but it will create infinite loop for MATLAB ..
Image Analyst
Image Analyst 2013 年 10 月 28 日
numberOfFramesProcessed = 0;
while numberOfFramesProcessed <= 10
% Your code goes here. Then increment:
numberOfFramesProcessed = numberOfFramesProcessed + 1;
end

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by