Convert System.Drawing.Image to Emgu.CV.Image<Gray,byte>

Sisay picture Sisay · May 6, 2013 · Viewed 11.3k times · Source

Is there any way to convert an Image of type System.Drawing.Image in to Image of Emgu.CV.Image type or vice versa on EmguCV using C#? I will explain per your request if additional explanation is needed about the purpose of doing this.

Answer

Waleed picture Waleed · May 7, 2013
// Converting the master image to a bitmap
Bitmap masterImage = (Bitmap) pbxMaster.Image;

// Normalizing it to grayscale
Image<Gray, Byte> normalizedMasterImage = new Image<Gray, Byte>(masterImage);