Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problems while including headers in OpenCV 2.4.9

Hi, I am looking an implementation of the five points algorithm in order to determine the essential matrix for a real-time application. The present version of OpenCV (2.4.4) does not include that algorithm. However, looking information about that in Google I discover that OpenCV 2.4.9 (available on github) has an implementation of the five point algorithm opencv/modules/calib3d/src/five-point.cpp. So I downloaded the source, compile it, and install it without any problem using cmake and a sudo make install.

My cmake configuration using cmake-gui:

General configuration for OpenCV 2.4.9 =====================================
Version control:               2.4.4-687-g87563c6

Host:                        Linux 3.5.0-26-generic x86_64
CMake:                       2.8.9
CMake generator:             Unix Makefiles
CMake build tool:            /usr/bin/make
Configuration:               Release

Built as dynamic libs?:      YES
C++ Compiler:                /usr/bin/c++  (ver 4.7.2)
C++ flags (Release):         -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mavx -ffunction-sections -O3 -DNDEBUG  -DNDEBUG
C++ flags (Debug):           -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mavx -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG -ggdb3
C Compiler:                  /usr/bin/gcc
C flags (Release):           -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mavx -ffunction-sections -O3 -DNDEBUG  -DNDEBUG
C flags (Debug):             -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mavx -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG -ggdb3
Linker flags (Release):      
Linker flags (Debug):        
Precompiled headers:         YES

OpenCV modules:
To be built:                 core imgproc flann highgui features2d calib3d ml video objdetect contrib legacy nonfree photo ts videostab
Disabled:                    gpu java softcascade stitching world
Disabled by dependency:      python(deps: softcascade)
Unavailable:                 androidcamera ocl

QT 4.x:                      YES (ver 4.8.3 EDITION = OpenSource)
QT OpenGL support:           YES (/usr/lib/x86_64-linux-gnu/
OpenGL support:              YES (/usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/

Media I/O: 
ZLib:                        /usr/lib/x86_64-linux-gnu/ (ver 1.2.7)
JPEG:                        /usr/lib/x86_64-linux-gnu/ (ver )
WEBP:                        build (ver 0.2.1)
PNG:                         /usr/lib/x86_64-linux-gnu/ (ver 1.2.49)
TIFF:                        /usr/lib/x86_64-linux-gnu/ (ver 42 - 4.0.2)
JPEG 2000:                   /usr/lib/x86_64-linux-gnu/ (ver 1.900.1)
OpenEXR:                     /usr/lib/ /usr/lib/ /usr/lib/ /usr/lib/ /usr/lib/ (ver 1.6.1)

Video I/O:
DC1394 1.x:                  NO
DC1394 2.x:                  YES (ver 2.2.0)
FFMPEG:                      YES
  codec:                     YES (ver 53.35.0)
  format:                    YES (ver 53.21.1)
  util:                      YES (ver 51.22.1)
  swscale:                   YES (ver 2.1.0)
  gentoo-style:              YES
  base:                      YES (ver 0.10.36)
  app:                       YES (ver 0.10.36)
  video:                     YES (ver 0.10.36)
OpenNI:                      NO
OpenNI PrimeSensor Modules:  NO
PvAPI:                       NO
GigEVisionSDK:               NO
UniCap:                      NO
UniCap ucil:                 NO
V4L/V4L2:                    Using libv4l (ver 0.8.8)
XIMEA:                       NO
Xine:                        YES (ver 1.1.21)

Other third-party libraries:
Use IPP:                     7.1.1 [7.1.1]
     at:                     /opt/intel/ipp
Use Eigen:                   YES (ver 3.0.93)
Use TBB:                     YES (ver 4.0 interface 6000)
Use OpenMP:                  NO
Use GCD                      NO
Use Concurrency              NO
Use C=:                      NO
Use Cuda:                    NO
Use OpenCL:                  NO

Interpreter:                 /usr/bin/python2 (ver 2.7.3)
Libraries:                   NO
numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.6.2)
packages path:               lib/python2.7/dist-packages

ant:                         /usr/bin/ant (ver 1.8.2)
JNI:                         /usr/lib/jvm/java-6-openjdk/include /usr/lib/jvm/java-6-openjdk/include /usr/lib/jvm/java-6-openjdk/include
Java tests:                  YES

Build Documentation:         YES
Sphinx:                      /usr/bin/sphinx-build (ver Sphinx v1.1.3)
PdfLaTeX compiler:           /usr/bin/pdflatex

Tests and samples:
Tests:                       YES
Performance tests:           YES
C/C++ Examples:              NO

Install path:                  /usr/local

cvconfig.h is in:              /home/raul/OpenCV/build2.4.9

The problem comes when I try to compile the following code:

#include <iostream>
#include "opencv2/opencv.hpp"
using namespace std;
using namespace cv;

int main() {
cout << "Hello World" << endl;
return 0;

The compiler displays the following message:

In file included from example.cpp:10:0:
/usr/local/include/opencv2/opencv.hpp:47:28: error fatal: opencv2/core.hpp: No such file or directory

I don't know the reason. I have never had that problem before in OpenCV 2.4.4

Can someone tell me what should I do?

Thanks in advance