MATLAB-關於insertObjectAnnotation出現錯誤

匿 匿名 645 次瀏覽 0 個回答

不好意想要請教各位
我目前正在學習使用Faster-RCNN來做目標檢測
整體訓練過程問題不大
但是在使用insertObjectAnnotation時
如果沒有檢測到目標
程式會直接強制停止
Command Windows上會顯示
Erroe using insertObjectAnnotation
LABEL to be nonempty
由於程式是循環檢測
本來就會出現沒有物體的狀況
想請教該如何讓程式跳過出現錯誤的那一幀
直接進入下一幀的循環呢?

附上程式碼
for i=1:6000
img=imread(['E:\碩士課程\影像資料\2\測試\frame
(',int2str(i),').jpg']);
[bbox,score,label]=detect(detector,img);
index = find(score>0.55);
bbox = bbox(index,:);
score = score(index,:);
label = label(index,:);
img=insertObjectAnnotation(img,'Rectangle',bbox,score);
detectedImg=insertShape(img,'Rectangle',bbox);
figure(1);
imshow(detectedImg);
end

目前有看到似乎可以利用try?或者是continue忽略接續
但是不清楚該如何使用
還請各位指導,謝謝!

--

我要回答

0 個回答

還沒有人回答,你知道答案嗎?

我要回答

登入會員後即可回答問題。

免費註冊