imcrop関数とfor構文を使って、検出された全ての顔を切り取り、Figureにひとつずつ表示するプログラムを教えてください。
5 views (last 30 days)
Show older comments
clear all
faceDetector = vision.CascadeObjectDetector;
I = imread('visionteam.jpg');
bboxes = faceDetector(I);
IFaces = insertObjectAnnotation(I,'rectangle',bboxes,'Face');
figure;
imshow(IFaces)
title('Detected faces'); %以下にimcrop関数を用いたプログラム
0 Comments
Answers (1)
Atsushi Ueno
on 11 Dec 2022
Edited: Atsushi Ueno
on 11 Dec 2022
clear all
faceDetector = vision.CascadeObjectDetector;
I = imread('visionteam.jpg');
bboxes = faceDetector(I);
IFaces = insertObjectAnnotation(I,'rectangle',bboxes,'Face');
figure;
imshow(IFaces)
title('Detected faces'); %以下にimcrop関数を用いたプログラム
%imcrop関数とfor構文を使って、検出された全ての顔を切り取り、Figureにひとつずつ表示する
for k = 1:size(bboxes,1)
ICrpd = imcrop(I,bboxes(k,:));
figure;
imshow(ICrpd)
end
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!