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

Polylines bad argument: expected Ptr<cv::UMat> for argument 'img' #181

Open
LiamSimons opened this issue Aug 24, 2022 · 2 comments
Open

Comments

@LiamSimons
Copy link

Only for some images the text detection fails with the error:
cv2.polylines(img, [poly.reshape((-1, 1, 2))], True, color=(0, 0, 255), thickness=2)
cv2.error: OpenCV(4.6.0) 👎 error: (-5:Bad argument) in function 'polylines'

Overload resolution failed:

  • Layout of the output array img is incompatible with cv::Mat
  • Expected Ptrcv::UMat for argument 'img'

I have looked for a difference between the working and to failed images but cannot seem to find a difference?

@GabrielDornelles
Copy link

I don't understand the question properly, but in my experience, this error occurs when opencv expects a numpy array, and most of the time its receiving None instead of a numpy array, and that could happen by a lot of different reasons, but its usually a problem at loading the image

@Acinonyx4
Copy link

Have you check the values of the predicted boxes?

Maybe it's the similar problem that I have recognized and fixed:
#198

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

3 participants