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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by