検出した領域内を分割する方法
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
tsuyoshi tsunoda
le 26 Oct 2021
Commenté : tsuyoshi tsunoda
le 30 Oct 2021
リアルタイムのカメラで顔のパーツを検出するといった事を行っており、vision.CascadeObjectDetector('EyePairBig')という両目を検出する関数を使用しているのですが、「検出した領域内を分割して目がある部分を目と設定する」といった事をやりたいです。
片目ずつ検出する方法を試したところ、精度が悪くこの方法でやろうと考えています。
イメージは、以下の画像のように「両目が検出された四角を6分割して2コマ目と5コマ目を目として設定する」といった感じです。
ご教授願います。もし、他の方法があればそちらも教えていただきたいです。

0 commentaires
Réponse acceptée
Atsushi Ueno
le 26 Oct 2021
EyePairBigDetector = vision.CascadeObjectDetector('EyePairBig');
I = imread('body_face_man.png');
bboxBody = EyePairBigDetector(I);
I = insertObjectAnnotation(I,'rectangle',bboxBody,'EyePairBig');
% Bounding Boxの位置は[x, y, width, height] ⇒ x座標に幅の1/6,4/6を足し、幅を1/6にする
lefteye = [bboxBody(1)+bboxBody(3)*1/6 bboxBody(2) bboxBody(3)/6 bboxBody(4)];
righteye = [bboxBody(1)+bboxBody(3)*4/6 bboxBody(2) bboxBody(3)/6 bboxBody(4)];
I = insertShape(I,'rectangle', lefteye,'Color','red','LineWidth',3);
I = insertShape(I,'rectangle',righteye,'Color','red','LineWidth',3);
imshow(I)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Image Processing and Computer Vision dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!