2019年7月11日木曜日

Matlab : Deep Learning : カメラ利用(顔認識)

Matlabで顔認識プログラムを動かします。下記のソースを簡略化したものです。
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
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
view raw face hosted with ❤ by GitHub

0 件のコメント:

コメントを投稿