Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to convert mat to image

Tags:

c#

emgucv

I need to convert a Mat to an Image in Emgu CV. Trying to cast a Mat to an image produces an exception: Cannot implicitly convert type 'Emgu.CV.Mat' to 'Emgu.CV.Image

Image<Bgr, Byte> imgeOrigenal;

Capture capWebcam = null;

imgeOrigenal = capWebcam.QueryFrame();//error line

How can I convert the Mat to an Image?

like image 564
Ehsan Jeihani Avatar asked Jan 21 '16 02:01

Ehsan Jeihani


1 Answers

the correct answer is the first comment @David_D sent under the question.

 Image<Bgr, Byte> imgeOrigenal = capWebcam.QueryFrame().ToImage<Bgr, Byte>();
like image 56
Ehsan Jeihani Avatar answered Oct 17 '22 14:10

Ehsan Jeihani