Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You are using those OpenCV binaries which are compiled without GPU support.</p> <p><code>C:\opencv\build\x86\...</code> are without GPU support.</p> <p>You have to use the binaries and lib files which are present in the <code>build\gpu</code> folder.</p> <p><code>C:\opencv\build\gpu\x86\...</code> are with GPU support.</p> <p><strong>UPDATE:</strong></p> <p>Procedure:</p> <p>In Visual Studio 2010, go to project properties. In the VC++ Directories, you will see the following page:</p> <p>Add the path of OpenCV <code>include</code> folder in the <strong>Include Directories</strong> textbox. Make sure that multiple paths are separated by a semicolon and there is no space in any of the path.</p> <p>Similarly add the path of OpenCV <code>lib</code> folders for both the GPU and Non-GPU versions in the <strong>Library Directories</strong> Textbox. (Don't forget the semicolon)</p> <p><strong>Important:</strong> When writing the paths in the box, first write the GPU path and after that, the Non-GPU path. </p> <p><img src="https://i.stack.imgur.com/FVWxa.png" alt="enter image description here"></p> <p>Next step is adding the path of <code>bin</code> folder of OpenCV. But not in visual studio, but in the <code>Path</code> Environment variable as shown below:</p> <p><img src="https://i.stack.imgur.com/sHslO.png" alt="enter image description here"></p> <ul> <li>Right Click <code>My Computer</code></li> <li>Go To Properties</li> <li>Go to <code>Environment Variables</code> section</li> <li>Edit the System Variable <code>Path</code></li> <li>Append <code>C:\OpenCV\build\gpu\x86\vc10\bin</code> <strong>and</strong> <code>C:\OpenCV\build\x86\vc10\bin</code> to the Path. Don't forget to separate different values with semicolon. Also---> <strong>GPU Comes First</strong>.</li> <li>Save and exit.</li> </ul> <p>Restart Visual Studio. The linker and <code>#include</code> directive will now recognize the OpenCV libraries. As we have added the path of the GPU libraries also, so complete GPU support will be available in OpenCV.</p> <p>To use GPU functionality of OpenCV, you just have to do the following:</p> <ul> <li><code>#include opencv2/gpu/gpu.hpp</code></li> <li>Specify <code>opencv_gpu243d.lib</code> for Debug Configuration, or <code>opencv_gpu243.lib</code> for Release Configuration in the Additional Dependencies field in the <code>Linker-&gt;Input</code> section of project properties.</li> </ul> <p><strong>Some Additional Info:</strong></p> <p>In Visual Studio, there is an easy way to link libraries instead of specifying them in the project properties.</p> <p>Just write these lines in the very start of your code:</p> <pre><code>#ifdef _DEBUG #pragma comment(lib,"opencv_core243d") #pragma comment(lib,"opencv_highgui243d") #else #pragma comment(lib,"opencv_core243") #pragma comment(lib,"opencv_highgui243") #endif </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload