知道如何转换 Image
输入 Image<Bgr, Byte>
类型?
我从 PictureBox
获取图像控件,我需要将其转换为 Image<Bgr, Byte>
类型。
Image pictureBoxImage = pictureBox.Image;
Image<Bgr, Byte> image = // ...
最佳答案
根据documentation :
Creating image from Bitmap
It is also possible to create an
Image<TColor, TDepth>
from a .NetBitmap
object
所以,你应该能够做到:
var image = new Image<Bgr, Byte>(new Bitmap(pictureBox.Image));
关于c# - 如何将 Image 类型转换为 Image<Bgr, Byte>?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12247802/