Traceback (most recent call last): File "C:\Users\Administrator\AppData\Roaming\JetBrains\IdeaIE2020.3\plugins\python-ce\helpers\pydev\pydevd.py", line 1477, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "C:\Users\Administrator\AppData\Roaming\JetBrains\IdeaIE2020.3\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "G:/jp/Scan/scan.py", line 101, in <module> cnts = sorted(cnts, key=cv2.contourArea, reverse=True)[:5] cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\shapedescr.cpp:315: error: (-215:Assertion failed) npoints >= 0 && (depth == CV
时间: 2023-08-22 12:09:50 浏览: 94
Mac下anaconda中Spyder打开报错Traceback(most recent call last)…问题
5星 · 资源好评率100%
这个错误和你之前提到的错误非常相似,因为它也是OpenCV库的错误信息。错误信息显示发生在shapedescr.cpp文件的第315行,错误内容为断言失败,即npoints必须大于等于0且depth等于CV。这可能是由于输入的参数不符合要求导致的。你需要检查你的代码,确保传入的参数正确,并且没有出现任何逻辑错误。另外,你可以查看你的代码中是否有调用OpenCV库的地方,看看是否有问题。
阅读全文