when i use this code matlab even hangs or give me constant blue screen any ideas ?
1 次查看(过去 30 天)
显示 更早的评论
if true
clear all
clc
cd c:\try
a=0;
obj = videoinput('winvideo', 1);
preview(obj);
frame =rgb2gray(getsnapshot(obj));
while a<1
% for i = 1:1000
frame1 = rgb2gray(getsnapshot(obj));
x= frame-frame1;
border = edge(x,'canny');
image(border);
end
end
0 个评论
回答(2 个)
Walter Roberson
2012-12-31
You never change "a" so it will always be less than 1.
Also you should add
drawnow()
after the image() call.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!