https://jp.mathworks.com/help/releases/R2017b/vision/examples/face-detection-and-tracking-using-the-klt-algorithm.html
Computer Vision System Toolboxのインストールが必要です。
https://jp.mathworks.com/products/computer-vision.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
camera = webcam; % Connect to the camera | |
videoFrame = snapshot(camera); | |
% Create a cascade detector object. | |
faceDetector = vision.CascadeObjectDetector(); | |
bbox = step(faceDetector, videoFrame); | |
% Draw the returned bounding box around the detected face. | |
videoFrame = insertShape(videoFrame, 'Rectangle', bbox); | |
figure; imshow(videoFrame); title('Detected face'); | |
% Convert the first box into a list of 4 points | |
% This is needed to be able to visualize the rotation of the object. | |
bboxPoints = bbox2points(bbox(1, :)); | |
clear camera |
0 件のコメント:
コメントを投稿