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

How to convert cv2.Mat() to cv2.UMat() #1030

Open
JV-X opened this issue Sep 19, 2024 · 0 comments
Open

How to convert cv2.Mat() to cv2.UMat() #1030

JV-X opened this issue Sep 19, 2024 · 0 comments

Comments

@JV-X
Copy link

JV-X commented Sep 19, 2024

Hello, I am trying to write some glue code for a third-party library.
In the code, I need to return a data of type cv2.UMat.
Now I can use cv2.Mat(descs) to get a Mat, but I can't find a way to convert cv2.Mat to cv2.UMat.
I tried umat = cv.UMat(mat), mat.copyTo(umat), umat = cv.UMat(descs.shape[0], descs.shape[1], descs.dtype, cv.USAGE_DEFAULT), but none of them worked.
I found on the Internet that there seems to be such a method in C to convert Mat to UMat, but I can't seem to find it in Python.
Can you give some suggestions?

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