Pergunta

I am new to OpenCV and I am currently working on a Java project concerning Face Detection. I came across this tutorial which is in c++ and the one place i got stuck at is the .hpp files.

I tried running this code in Turbo C++ but it says unable to open include file 'opencv2/highgui.hpp' and likewise for all the hpp files.

To resolve the error 1) I copied the opencv2 folder from C:\OpenCV-2.4.7\opencv\build\include to C:\turbo\tc\bi\include which is my INCLUDE Directory as specified in the Options>Directories of Turbo C++.

Can we specify multiple INCLUDE Paths in Turbo c++? Please tell a way to include these hpp files so that the c++ code executes..I know the problem is with the folders path, but I'm not able to resolve the issue any further. Thanks!

Foi útil?

Solução

To find where is your opencv.hpp file, on linux the easier is to run:

# find / -name opencv.hpp

This will give you the path for your opencv files.

Consider the path where you placed you OpenCV. -- e.g. C:\Program Files\OpenCV\include . The path may change according to the way you installed the OpenCV and according to your operational system.

In linux you should include the path to your profile. For that you can use bash_profile or bashrc. http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html

One way to do it is like:

#include "opencv2/opencv.hpp"
#include "opencv.hpp"

You can also specify the paths for hpp or any other files in your make file.

Here some examples:

http://www.digitalpeer.com/id/example

http://www.cs.duke.edu/~ola/courses/programming/libraries.html

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top