C# EmguCV bitmap 转 Mat

            Bitmap bitmap = new Bitmap("C:\\test.bmp");
            Emgu.CV.Image ImageEmgu = new Image(bitmap.Width, bitmap.Height);
            ImageEmgu = BitmapExtension.ToImage(bitmap);
            Mat mat = ImageEmgu.Mat;
            mat.ConvertTo(mat, Emgu.CV.CvEnum.DepthType.Cv8U);
            mat.Save("C:\\test2.bmp");

你可能感兴趣的:(AI,C#,c#,计算机视觉,opencv)