c# - 如何将 Image 类型转换为 Image<Bgr, Byte>?

标签 c# .net opencv emgucv

知道如何转换 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 .Net Bitmap object

所以,你应该能够做到:

var image = new Image<Bgr, Byte>(new Bitmap(pictureBox.Image));

关于c# - 如何将 Image 类型转换为 Image<Bgr, Byte>?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12247802/

相关文章:

c# - 防止来自 LINQ 查询的新值

c# - 正确使用多键词典的自定义数据结构

c++ - ROS "catkin_make"找不到OpenCVConfig.cmake

c++ - OpenMP:为什么这个应用程序有时会扩展?

c# - Silverlight:在 XAML 中声明数据集合?

c# - 防止 Asp.NET 按钮提交表单

C#: "Using"带有 HttpWebRequests/HttpWebResponses 的语句

c# - 使用动态对象调用 Web Api 2 和 HttpClient

c# - Process.GetProcessById 启用 "debug mode"

python - OpenCV Python,从命名管道读取视频