C# EmguCV bitmap 转 Mat

486 阅读1分钟
            Bitmap bitmap = new Bitmap("C:\\test.bmp");
            Emgu.CV.Image<Bgr, UInt16> ImageEmgu = new Image<Bgr, UInt16>(bitmap.Width, bitmap.Height);
            ImageEmgu = BitmapExtension.ToImage<Bgr, UInt16>(bitmap);
            Mat mat = ImageEmgu.Mat;
            mat.ConvertTo(mat, Emgu.CV.CvEnum.DepthType.Cv8U);
            mat.Save("C:\\test2.bmp");