将byte []转换为Image <bgr,byte =“”>

时间:2017-07-07 16:42:37

标签: c# image bitmap emgucv

我正在尝试将字节数组转换为图像。网上有很多引用,例如this SO postthis emgu forum以及emgu official docs

但是当我根据SO帖子和阅读的Emgu文档实现解决方案时出现错误

无法从System.Drawing.Bitmap转换为inputOne == "Yes" ? "517" : "518"; inputTwo == "Yes" ? "518" : "519"; inputThree == "Yes" ? "519" : "520"; inputFour == "Yes" ? "520" : "521";

byte[*,*,*,*]

有关如何使这项工作的任何建议?

1 个答案:

答案 0 :(得分:1)

public Image<Bgr, Byte> CreateImageFromBytesArray(byte[] bytes)
{
    Image<Bgr, Byte> image = new Image<Bgr, Byte>(width, height);
    image.Bytes = bytes
    return image;
}