物体検出でのラベル表示方法について
Show older comments
こんにちは。
学習し終えた物体検出器(Faster R-CNNやYOLOv2)を動画像を用いて検証を行っております。その際に、検出した物体のラベルを動画像上に表示させたく以下のようにプログラムしたのですが、エラーが発生してしまいます。原因としては、物体が検出されないためラベルも検出されずエラーが起き動画がストップしてしまいます。
物体が検出された場合のみラベルを表示されるには、どのようにすれば宜しいでしょうか。
よろしくお願いいたします。
[bboxes, score, label] = detect(rcnn, videoFrame,'NumStrongestRegions', 50,'MaxSize',[106 106]);
[selectedBbox,selectedScore,index] = selectStrongestBbox(bboxes,score, 'RatioType','Min', ...
'OverlapThreshold',0.5);
idx = selectedScore > 0.90
videoFrame = insertObjectAnnotation(videoFrame,'rectangle',...
selectedBbox(idx,:), cellstr(label(idx)), 'color','r');
このコードを実行すると以下のようなエラーが発生してしまいます。
エラー: insertObjectAnnotation
LABELは空以外にする必要があります。
エラー: insertObjectAnnotation>checkLabel (line 300)
validateattributes(label,{'cell'}, {'nonempty', 'vector'}, ...
エラー: insertObjectAnnotation>validateAndParseInputs (line 180)
checkLabel(label);
エラー: insertObjectAnnotation (line 123)
validateAndParseInputs(I, shape, position, label, varargin{:});
エラー: RCNNVideoRead_2 (line 60)
videoFrame = insertObjectAnnotation(videoFrame,'rectangle',...
Accepted Answer
More Answers (0)
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!