imcrop関数とfor構文を使って、検出された全ての顔を切り取り、Figureにひとつずつ表示するプログラムを教えてください。
古いコメントを表示
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関数を用いたプログラム
回答 (1 件)
Atsushi Ueno
2022 年 12 月 11 日
編集済み: Atsushi Ueno
2022 年 12 月 11 日
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
カテゴリ
ヘルプ センター および File Exchange で Process Point Clouds についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!