0

I am trying to include GPU using OpenCvSharp. I installed the OpenCvSharp by using Nuget Package Manager in Microsoft Visual Studio 2013.

I have included these lines already

                 using OpenCvSharp;
                 using OpenCvSharp.CPlusPlus;
                 using OpenCvSharp.CPlusPlus.Gpu;

but when i check the device count

  //GPU
                int count = Cv2Gpu.GetCudaEnabledDeviceCount();
                //int count = Cv2Gpu.ge
                Console.WriteLine("The GPU Device count is " +  count.ToString());

it always returns 0.

Now it also says if OpenCv is not compiled with CUDA then it always returns 0. it does not even get DeviceDetails.

4

1 回答 1

0

我通过构建 opencv_core.dll 和 opencv_gpu.dll 解决了这个问题。

使用 Cmake 制作 opencv 的源代码,在配置源代码时不要忘记选择“withcuda”选项。

生成后,在构建文件夹中打开 OpenCv 解决方案,首先构建 opencv_core,然后构建 opencv_gpu。

一旦你在 bin 文件夹中获得了 dll,将它们替换到 opencvsharp 包文件夹中。现在再次构建项目。现在项目会将新的 dll 复制到所需的文件夹中。

于 2015-09-30T12:02:12.573 回答