[請益]關於insertObjectAnnotation出現錯誤已刪文

看板MATLAB作者 (楓葉飄逸)時間3年前 (2020/09/08 19:06), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
不好意想要請教各位 我目前正在學習使用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忽略接續 但是不清楚該如何使用 還請各位指導,謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.166.45.245 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/MATLAB/M.1599563168.A.598.html
文章代碼(AID): #1VLsMWMO (MATLAB)
文章代碼(AID): #1VLsMWMO (MATLAB)