Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert EmguCV image to system drawing bitmap

I am writing a c# program with emgucv library. I use the imagebox in emgucv to capture image from webcam. And I want to get the color pixel of the image by using bitmap.Getpixel() by mouse clicking the imagebox. However, it contain error The error is..it cannot implicitly convert type 'Emgu.CV.IImage' to 'System.Drawing.Bitmap'

Can anyone give me idea to solve this problem?

      Bitmap bitmap = newdetectimageBox.Image; //error
like image 326
user1994617 Avatar asked Jan 14 '23 23:01

user1994617


1 Answers

Please use this code

 Image<Bgr, Byte> ImageFrame = newdetectimageBox.Image ; //Capture the cam Image 
 Bitmap BmpInput = ImageFrame.ToBitmap(); //Convert the emgu Image to BitmapImage 
like image 105
vikas singh aswal Avatar answered Jan 29 '23 10:01

vikas singh aswal