How to solve the error with imgproc.hpp and core.hpp?

I used a C ++ program for image processing using opencv 2.1. and this program contains the files below:

#include "opencv2/core/core.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include <iostream> #include <math.h> #include <string.h> 

but after debugging the program, I get an error message like:

Fatal error C1083: Cannot open include file: 'opencv2 / core / core.hpp': There is no such file or directory.

which is similar to imgproc.hpp and highgui.hpp , after which I changed #include "opencv2/highgui/highgui.hpp" to #include <highgui.h> and this error was resolved.

But I could not find a solution for imgproc.hpp and highgui.hpp , and there are no files named imgproc.hpp and highgui.hpp inside the opencv folder.

How can I solve this error?

+4
source share
2 answers

From the path separator, I assume you are using * nix OS. Therefore, the following shell commands should help you find the correct location for the header files:

 locate highgui.h locate highgui.hpp 
+1
source

As already mentioned, your libraries are not included in the scope. Most people have adapted their answers to a Linux-based system, but if you are working on Windows (that is, using Visual Studio), you can simply include the entire path to the library folder in the include statement.

For instance:

 #include "C:\OpenCV\bin\install\opencv2\highgui\highgui.hpp" #include "C:\OpenCV\bin\install\opencv2\imgproc\imgproc.hpp" 

Recently, I had my share of errors after trying to install OpenCV 2.4.1, and finding the right directories to include (for both include and lib) was difficult at first. I recommend reinstalling your OpenCV and moving from there.

http://opencv.willowgarage.com/wiki/InstallGuide

-3
source

All Articles