SharpCV
SharpCV copied to clipboard
Implement imdecode
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);
}