Emgu CV显示GpuImage

时间:2013-02-01 07:31:27

标签: c# wpf emgucv

我正在逐帧使用Emgu.CV进行一些视频处理。从Capture实例中获取帧后,我将Image转换为GpuImage进行GPU处理。

是否可以直接显示GpuImage而无需返回Image?

我的用户界面在WPF上。

1 个答案:

答案 0 :(得分:0)

是的,可以在Emgu.CV.UI.ImageBox中显示GpuImage:

我在以下测试过:emgucv-windows-universal-gpu 2.4.9.1847

// Create a new GpuImage and assign its value from Image.
GpuImage<Bgr, byte> gpuImage = new GpuImage<Bgr, byte>(image);

// Show the GpuImage in the ImageBox.
this.imageBox.Image = gpuImage;

这个解决方案是我能看到的最好的解决方案,但无论哪种方式将GpuImage转换回Image都很简单快捷:

// Create a new Image and convert the GpuImage to it.
Image<Bgr, byte> image = gpuImage.ToImage();

// Show the GpuImage in the ImageBox.
this.imageBox.Image = image;

希望这有帮助!

一旦获得了解,Emgu就是一个很好的资源。它的布局和编程非常好。然而,GPU处理肯定是要走的路。