Closed acrith2015 closed 2 years ago
There is a solution to this problem: https://stackoverflow.com/questions/67921192/5bad-argument-in-function-rectangle-cant-parse-pt1-sequence-item-wit#
Hi, since you are using OpenCV 4.5.5, which is a higher version than this repo (4.0.0), I guess the function cv2.pointPolygonTest()
expects different types of arguments now. Maybe you can try cv2.pointPolygonTest(polyB, (int(x), int(y)), True)
?
老师您好,在照着您的建议修改之后,在surround_view\utils.py文件中出现了如下问题C = sorted(cnts, key=lambda x: cv2.contourArea(x), reverse=True)[0]IndexError: list index out of range,请问该如何解决?
你试试把 sorted(cnts, key=lambda x: cv2.contourArea(x), reverse=True)
结果打印出来,看看返回了一个什么。
老师您好,在照着您的建议修改之后,在surround_view\utils.py文件中出现了如下问题C = sorted(cnts, key=lambda x: cv2.contourArea(x), reverse=True)[0]IndexError: list index out of range,请问该如何解决?
请问您解决了吗。我目前也是遇到了这个错误
Hi, the error when runs "run_get_weight_matrices.py". Please help, thank you very much!
File "run_get_weight_matrices.py", line 36, in
main()
File "run_get_weight_matrices.py", line 24, in main
Gmat, Mmat = birdview.get_weights_and_masks(projected)
File "/home/idriver/work/AVP/surround-view-system-introduction-master/surround_view/birdview.py", line 301, in get_weights_and_masks
G0, M0 = utils.get_weight_mask_matrix(FI(front), LI(left))
File "/home/idriver/work/AVP/surround-view-system-introduction-master/surround_view/utils.py", line 114, in get_weight_mask_matrix
distToB = cv2.pointPolygonTest(polyB, (x, y), True)
cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function 'pointPolygonTest'