Ich fand diese [http://www.emgu.com/forum/viewtopic.php?t=1057]
public Image<Bgr, Byte> byteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
Bitmap returnImage = Image.FromStream(ms);
return new Image<Bgr, byte>(returnImage);
// you probably need to clean up stuff like the bitmap and the stream...
}
Auf dem emgu Forum und abgetippt es einen Variablenname Tippfehler zu entfernen. Angenommen, Ihr Byte-Array ist ein Standard-Image, sieht so aus, als könnten Sie es in eine Standard-Image-Variable laden, die automatisch die Größe ermittelt. Von dort könnten Sie dieses Bild an den Konstruktor Ihres Emgu-Bildes übergeben.
Funktioniert gut !!! Es ist jedoch notwendig, die Umwandlung von Bild zu Bitmap wie folgt einzufügen: Bitmap returnImage = (Bitmap) Image.FromStream (ms); – asegurpe