How to show video in axes for MATLAB Gui

3 次查看(过去 30 天)
Hi, I wish to show the video for eye detection in GUI using the vision.CascadeObjectDetector('EyePairBig') by the following code
if true
EyeDetect = vision.CascadeObjectDetector('EyePairBig');
obj = imaq.VideoDevice('winvideo',1,'YUY2_640x480');
set(obj,'ReturnedColorSpace','rgb');
figure('menubar','none', 'tag', 'webcam');
while(true)
frame=step(obj);
bb=step(EyeDetect,frame);
IEye=insertObjectAnnotation(frame,'rectangle',bb,'Eye');
imshow(IEye,'border','tight')
f=findobj('tag','webcam');
if(isempty(f))
break
end
pause(0.05)
end
release(obj)
end
However i am stuck as from previous examples to preview video in gui i need to use this code
if true
handles.output = hObject;
axes(handles.axes1);
vid=videoinput('winvideo', 1, 'YUY2_640x480');
himage=image(zeros(640, 480, 3),'parent', handles.axes1);
preview(vid,himage);
end
What should i use to make the eye detection function and show onto the axes?
  1 个评论
JOVEL JOSE
JOVEL JOSE 2015-6-12
While creating your gui just add an extra axes Matlab automatically recognizes the axes and add the video to that axes

请先登录,再进行评论。

回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by