Using GPU in OpenCV - opencv

If I want to use my computer's GPU with OpenCV, is it necessary that I build OpenCV from source with CUDA enabled? Or can I install OpenCV with CUDA support via apt-get? I noticed the following 2 packages in apt-get:
libopencv-gpu-dev - development files for libopencv-gpu2.4v5
libopencv-gpu2.4v5 - computer vision GPU library
But I am not sure if these will work with OpenCV3 or if they are only compatible with OpenCV2. I know that the gpu module in Opencv2 was split up into multiple CUDA modules in OpenCV3.

Yes it is necessary that you build opencv from the source with CUDA option enabled. The apt-get packages won't work with OpenCV3 and above versions. I suggest you install the CUDA Toolkit first and then attempt installation of OpenCV or the GPU functions won't work.

Related

Using OpenCV with gpu support in anaconda

I'm using Windows with a GTX 1050.
Currently I'm working with OpenCV in object detecting using yolo model. I found it's quite slow at ~7fps. I tried to install OpenCV with GPU support but it's only run when I execute the Python script in cmd, i mean not in Anaconda.
Is there any possible way to install OpenCV with GPU support?

OpenCV error: No GPU support, cannot build with WITH_CUDA=ON

I am trying to make OpenCV project using GPU. I installed OpenCV v2.4.13 and NVidia CUDA Toolkit. I added additional include and library directories in configuration and OpenCV project works correctly without GPU functions. But when I'm trying to run openCV with GPU I get an error like this:
OpenCV Error: No GPU support (The library is compiled without CUDA support) in EmptyFuncTable::mallocPitch, file C:\builds\2_4_PackSlave_win32_vc12-shared\opencv\modules\dynamicuda\include\opencv2/dynamicuda/dynamicuda.hpp, line 126
Libary has been compiled without CUDA, so i tried to build the sources myself, with WITH_CUDA=ON in CMake, but when building Visual Studio 2013 has been giving me an errors that he cannot find opencv_core2413d.lib.
What can I do with this?

opencv error: no GPU support

I have install Cuda 6.5 and opencv 2.4.9 with visual studio 2010, when I run gpu, I get error
Opencv Error: No GPU support(the library is compiled without PGU support) in the row_nogpu, file C:/builds/2_4_Packslave-win32-vc10-shared/opencv/modules/gpu/src/precomp.hpp line 135
I get this error, is any one can help what do I have to do?
Thanks
I believe, you have to actually build the libraries with CUDA support. I Imagine This Guide will be useful.
This can be caused because of following.
Use the flag WITH_CUDA=ON during cmake
You are trying to load the libraries which are compiled without GPU support, after you install opencv make sure you change the libraries path to that of GPU supported once.

opencv 2.4.4 no gpu support error

In the post OpenCV 2.4.3rc and CUDA 4.2: "OpenCV Error: No GPU support" , it is said that C:\opencv\build\gpu\x86... libs must be added instead of C:\opencv\build\x86... ones. But there is no gpu folder for 2.4.4 realese. I added opencv_gpu244.lib lib file for release and opencv_gpu244d.lib for debug modes on vs 2010 conf. which are reside in C:\opencv\build\x64\vc10\lib. But i get opencv error ( no gpu support ): the library is compiled without cuda support. By the way i!'m using cuda toolkit 5.0.
The procedure described in the given answer, still applies to the current distribution of OpenCV. There is just 1 small difference. The pre-built distribution of OpenCV 2.4.4 does not contain GPU binaries. To add GPU support, you have to build the library yourself using CMake.
OpenCV 2.4.4 is optimized for Kepler architecture GPUs. In version 2.4.3, only the GPU binaries are approximately 1.4 GB. So you can guess, that adding the code for Compute capabilty 3.0 and 3.5 would make this even larger. So it is not feasible to ship these binaries, and that is why the gpu folder is not present in version 2.4.4 prebuilt distribution.
You should compile OpenCV libraries using CMake with CUDA support ( there is a checkbox ). Before releases include pre-compiled gpu files.

Can not find CUDA_NPP_LIBRARY_ROOT_DIR in cmake

I am trying to install opencv 2.2 with cuda enabled. I have installed CUDA and also have compiled and tested some programs with it.
Now I want to install opencv with gpu. I downloaded cmake-gui and set CUDA on. When I hit the configure button it does find cuda toolkit but gives me this error:
CMake Error at modules/gpu/FindNPP.cmake:102 (message):
NPP headers/libraries are not found. Please specify
CUDA_NPP_LIBRARY_ROOT_DIR in CMake or set $NPP_ROOT_DIR.
Call Stack (most recent call first):
modules/gpu/CMakeLists.txt:38 (find_package)
I have installed everything in the default directory.
My cuda-toolkit version is 4.0. Also I have opencv 2.2 without gpu installed.
And in case it might help:
My OS is ubuntu 11.04, my gpu is geforce gtx550, and my cuda driver version is 280.13

Resources