Mic*_*ael 2 .net c# opencv emgucv
知道如何将Image类型转换为Image<Bgr, Byte>类型吗?
我从 Control 获取图像PictureBox,需要将其转换为Image<Bgr, Byte>类型。
Image pictureBoxImage = pictureBox.Image;
Image<Bgr, Byte> image = // ...
Run Code Online (Sandbox Code Playgroud)
根据文档:
从位图创建图像
Image<TColor, TDepth>也可以从 .NetBitmap对象创建
所以,你应该能够做到:
var image = new Image<Bgr, Byte>(new Bitmap(pictureBox.Image));
Run Code Online (Sandbox Code Playgroud)