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

Implement imdecode #13

Open
tk4218 opened this issue Jun 10, 2020 · 0 comments
Open

Implement imdecode #13

tk4218 opened this issue Jun 10, 2020 · 0 comments

Comments

@tk4218
Copy link

tk4218 commented Jun 10, 2020

I have an image that is loaded in memory that I need to get into a Mat object.

Can cv2.imdecode() be implemented as it is in OpenCvSharp? It looks like this was already partly implemented in cv2_native_api.imgcodecs.cs with the imgcodecs_imdecode_vectors() method.

This would be simple to implement by adding the following to cv2,imgcodecs.cs

    public Mat imdecode(byte[] buf, IMREAD_COLOR flags = IMREAD_COLOR.IMREAD_COLOR)
    {
        cv2_native_api.imgcodecs_imdecode_vector(buf, new IntPtr(buf.Length), (int) flags, out var handle);
        return new Mat(handle);
    }
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