You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to construct an Image<Bgr, Byte> instance from byte[].
var img = new Image<Bgr, Byte>(width, height);
img.Bytes = imageBytes;
But it doesn't create the correct EmguCV image representation. I tried the same using a stream as well as SKBit, but couldn't get it to work. However, it works perfectly when creating it from a file path as shown below.
var img = new Image<Bgr, Byte>(imgPath);
Appreciate your help with this.
The text was updated successfully, but these errors were encountered:
For the Bytes property, you need to pass the raw pixel data. In the above case, it need to be a byte array of 3 x width x height arranged in RGB format. Passing the Jpeg stream will not work.
If the imageBytes is JPEG stream instead of raw pixel data, you need to decode the jpeg data by calling:
Mat img= new Mat();
CvInvoke.Imdecode(jpegBytes, Emgu.CV.CvEnum.ImreadModes.Color, img)
I am trying to construct an Image<Bgr, Byte> instance from byte[].
But it doesn't create the correct EmguCV image representation. I tried the same using a stream as well as SKBit, but couldn't get it to work. However, it works perfectly when creating it from a file path as shown below.
var img = new Image<Bgr, Byte>(imgPath);
Appreciate your help with this.
The text was updated successfully, but these errors were encountered: