【问题标题】:Matlab GUI face tracking functionMatlab GUI人脸跟踪功能
【发布时间】:2015-02-28 05:10:09
【问题描述】:

您好,我正在创建一个 Matlab GUI,它允许网络摄像头在执行人脸跟踪功能后检测人脸。但是,我只能检测到人脸,但不会跟踪人脸。

% --- Executes on button press in Tracking.
function Tracking_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% hObject    handle to startStopCamera (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Create a cascade detector object.
faceDetector = vision.CascadeObjectDetector();

% Read a video frame and run the detector.
axes(handles.cameraAxes);    
frame  = getsnapshot(handles.vid); 
bbox   = step(faceDetector,frame);


% Draw the bounding box around the face.
rectangle('Position',bbox(1,:),'LineWidth',2,'EdgeColor',[1 1 0]);

%Track the face over successive video frames until the video is finished.
 while ~isDone(handles.vid)

% Extract the next video frame
frame = getsnapshot(handles.vid);
bbox   = step(faceDetector,frame);

% Insert a bounding box around the object being tracked
rectangle('Position',bbox(1,:),'LineWidth',2,'EdgeColor',[1 1 0]);


% Display the annotated video frame using the video player object
getsnapshot(handles.vid);

  end

 release(frame);
 release(handles.vid);

我正在使用图像采集工具箱,并访问了几个网站,但我似乎无法解决问题。

非常感谢任何帮助!

【问题讨论】:

    标签: matlab computer-vision face-detection matlab-cvst


    【解决方案1】:

    【讨论】:

    • 您好,我已经尝试了这些示例,但我的程序似乎不起作用
    • @Helen,这些示例正是您所需要的。如果您确切了解它们的工作原理,您应该能够为您的项目调整它们的代码。也看看这个例子:mathworks.com/matlabcentral/fileexchange/…
    猜你喜欢
    • 2016-09-07
    • 1970-01-01
    • 2011-09-15
    • 2013-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-12
    相关资源
    最近更新 更多