c# - 将EmguCV图像转换为系统绘图位图

标签 c# winforms emgucv

我正在用 emgucv 库编写一个 C# 程序。 我使用 emgucv 中的图像框从网络摄像头捕获图像。 我想通过鼠标单击图像框使用 bitmap.Getpixel() 来获取图像的颜色像素。 然而, 它包含错误错误是..它不能隐式地将类型'Emgu.CV.IImage'转换为'System.Drawing.Bitmap'

谁能给我解决这个问题的想法?

      Bitmap bitmap = newdetectimageBox.Image; //error

最佳答案

请使用此代码

 Image<Bgr, Byte> ImageFrame = newdetectimageBox.Image ; //Capture the cam Image 
 Bitmap BmpInput = ImageFrame.ToBitmap(); //Convert the emgu Image to BitmapImage 

关于c# - 将EmguCV图像转换为系统绘图位图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15406235/

相关文章:

c# - 如何处理 Autofac 容器?

c# - 我无法思考如何在 C# 中使用正则表达式或如何解决我的问题

c# - 最简单的 Paint 程序无法在 C# Windows 窗体中运行

c# - 标签上的 "Invoke or BeginInvoke cannot be called on a control until"

c# - 轮廓的arcLength结果是什么?

c# - 在 c# winApplication 中使用 SSL

c# - UWP 最佳使用方式 x :Bind and filter ObservableCollection

c# - 在 C# 中分析 GPU 使用情况

c# - 有什么方法可以在C#中使用emguCV比较两个面孔?

c# - EF Core 2.0 使用 where 条件时不加载相关实体