1

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

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

我的用户界面在 WPF 上。

4

1 回答 1

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 处理绝对是要走的路。

于 2013-09-03T09:51:41.530 回答