Lemmouchi Rédha Dida Lemmouchi Rédha Dida - 3 months ago 37
C# Question

How to convert Bitmap to Image<Bgr, Byte>

I am using the OpenCV library for image processing.

I want to convert a

System.Drawing.Bitmap
to an
Image<Bgr, Byte>
. How can I do this?

Answer

The Image constructor has a Bitmap overload (assuming you're using the Emgu CV wrapper since you've marked it .NET).

Image<Bgr, Byte> myImage = new Image<Bgr, Byte>(myBitmap); 
Comments