Azzera filtri
Azzera filtri

How to show video in axes for MATLAB Gui

3 visualizzazioni (ultimi 30 giorni)
Jia Zhen
Jia Zhen il 31 Mar 2015
Commentato: JOVEL JOSE il 12 Giu 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 Commento
JOVEL JOSE
JOVEL JOSE il 12 Giu 2015
While creating your gui just add an extra axes Matlab automatically recognizes the axes and add the video to that axes

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by