(1)轉(zhuǎn)為 bitmap:
Bitmap map = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat);
process_pictureBox.Image = map;
(2)Image img 轉(zhuǎn)為Mat
Bitmap bitmap = new Bitmap(img);//Image img
OpenCvSharp.Mat mat = OpenCvSharp.Extensions.BitmapConverter.ToMat(bitmap);//用bitmap轉(zhuǎn)換為mat
C#中Bitmap 與 Image 之間的轉(zhuǎn)換
Image img = pictureBox1.Image;
Bitmap map = new Bitmap(img);
而Bitmap直接可以賦值 給 Image 對(duì)象
Image img = Bitmap;
|