Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

城市任务判定报错 #68

Open
csho opened this issue May 4, 2020 · 0 comments
Open

城市任务判定报错 #68

csho opened this issue May 4, 2020 · 0 comments

Comments

@csho
Copy link

csho commented May 4, 2020

如果出现以下错误:
File "C:\Users\zhang\Documents\workspace\adbs\JGMA\cv.py", line 71, in findTaskBubble if len(cnts[1]): TypeError: object of type 'NoneType' has no len()
可能是cv2版本问题,我没详查。我的是opencv-python 4.2.0.34
修改源码cv.py中

       if len(cnts[1]):
            return True
        else:
            return False

      if cnts[1] is None:
            return False
        elif len(cnts[1]):
            return True
        else:
            return False

加一条判定,避免NoneType错误,可解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant