How to create Emgu Image from System.Drawing.Image?

前端 未结 3 1590
没有蜡笔的小新
没有蜡笔的小新 2021-01-15 05:32

I have a source that gives me a jpeg in memory stream (Bytes).
I can convert it to System.Drawing.Image but I don\'t know how
to convert it to Emgu Image.

M

3条回答
  •  长发绾君心
    2021-01-15 06:14

    You can convert your array bytes to Emgu Image<,> with a code like the following...

    public Image CreateImageFromBytesArray(byte[] bytes)
    {
         MemoryStream ms = new MemoryStream(bytes);
         Bitmap bmpImage = (Bitmap) Image.FromStream(ms);
         return new Image(bmpImage);         
    }
    

提交回复
热议问题