YOLOv3を用いて学習させた検出器で、馬の顔領域を検出したいと考えています。一つの画像から1頭のみを検出したく、検出されたバウンディングボックスのうち、最も大きなものだけを表示させる方法を知りたいのですがどなたかご教授頂けないでしょうか。
8 views (last 30 days)
Show older comments

この画像から、手前の2頭が検出されてしまいます。手前の茶色馬だけを検出する方法を教えていただきたいです。
0 Comments
Accepted Answer
Shunichi Kusano
on 7 Jan 2022
バウンディングボックスには幅と高さの情報が入っています。また、バウンディングボックスと一緒にscoreという検出の信頼性みたいな値も出てきます。
[bbox,score,label] = detect(yolonet,img);
最も大きいという基準で選択したいなら
area = bbox(:,3) .* bbox(:,4);
[~,Idx] = max(area);
bbox1 = bbox(Idx,:);
最も信頼性が高い、なら
[~,Idx] = max(score);
bbox1 = bbox(Idx,:);
といった感じで画像から一つだけ取り出すことができます。
More Answers (0)
See Also
Categories
Find more on オブジェクト解析 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!