How to show video in axes for MATLAB Gui

1 visualización (últimos 30 días)
Jia Zhen
Jia Zhen el 31 de Mzo. de 2015
Comentada: JOVEL JOSE el 12 de Jun. de 2015
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 comentario
JOVEL JOSE
JOVEL JOSE el 12 de Jun. de 2015
While creating your gui just add an extra axes Matlab automatically recognizes the axes and add the video to that axes

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by