![](/img/trans.png)
[英]How to fix opencv/modules/objdetect/src/cascadedetect.cpp:1698: error: (-215:Assertion failed) !empty() in function 'detectMultiScale'^?
[英]How to fix Opencv arcLength function error: (-215:Assertion failed)
以下代碼給了我以下錯誤:
contours = cv2.findContours(horizontal_lines_canvas, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
contours = contours[1]
contours = sorted(contours, key=lambda c: cv2.arcLength(c, True), reverse=True)[:2]
錯誤:
cv2.error:OpenCV(4.0.0)/Users/travis/build/skvark/opencv-python/opencv/modules/imgproc/src/shapeescr.cpp:237:錯誤:(-215:斷言失敗)計數> = 0 && (depth == CV_32F || depth == CV_32S) 在 function 'arcLength'
為什么這樣? 一切似乎都是正確的
謝謝你,漢斯希爾斯。
替換為:
contours, hierarchy = cv2.findContours(..
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.