getframe is zoomed in or incomplete
1 回表示 (過去 30 日間)
古いコメントを表示
Please help. I'm creating a GUI using GUIDE and the gui should be able to detect the face of the user. The live camera feed would appear on axes 1 and a frame of that camera feed would appear on axes 2. The image on axes 2 should have a bounding box placed on the face. The image on axes 2 always appears as a zoomed in image of axes 1 and the gui. It used to work properly earlier but i dont know what happened.
FOR AXES 1
% --- Executes just before untitled is made visible.
function untitled_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to untitled (see VARARGIN)
% Choose default command line output for untitled
set(handles.axes1,'box','on', 'xtick',[],'ytick',[]);
set(handles.axes2,'box','on', 'xtick',[],'ytick',[]);
handles.output = hObject;
axes(handles.axes1);
vid=videoinput('winvideo',1);
himage=image(zeros(720, 1280,3), 'parent', handles.axes1);
preview(vid,himage);
FOR AXES 2
while 1
im = getframe(handles.axes1);
im = im.cdata;
bboxes = step(faceDetector, im);
vo = insertObjectAnnotation(im,'rectangle',bboxes,'FACE');
axes(handles.axes2);
imshow(vo);
kx = kx + 1;
if kx > 10 && ~isempty(bboxes)
break
end
end
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Image Processing and Computer Vision についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!