Skip to content

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

@JV-X

Description

@JV-X

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions