I am using 2.4.7 version of opencv that supports face recognition. However I am receiving the following error:
/home/fereres/recognition-build-desktop- Qt_4_8_1_in_PATH__System__Release/../recognition/program.cpp:58: error: 'FaceRecognizer' was not declared in this scope
EDIT: The program is working since I've just change computer. I've followed the same instructions to install OpenCV. What could be responsible for that error?? My QT pro file is the following:
QT += core
QT -= gui
TARGET = identification
CONFIG += console/home/fereres/projectCV-build-desktop- Qt_4_8_1_in_PATH__System__Release
CONFIG -= app_bundle
TEMPLATE = app
INCLUDEPATH += /home/fereres/Desktop/OpenCV/opencv-2.4.7/include/opencv \
INCLUDEPATH += /home/fereres/Desktop/OpenCV/opencv-2.4.7/include/opencv2 \
INCLUDEPATH += /home/fereres/Desktop/OpenCV/opencv-2.4.7/modules/core/include/opencv2/core
LIBS += -L/home/fereres/Desktop/OpenCV/opencv-2.4.7/build/lib \
-lopencv_core \
-lopencv_imgproc \
-lopencv_highgui \
-lopencv_ml \
-lopencv_video \
-lopencv_features2d \
-lopencv_calib3d \
-lopencv_objdetect \
-lopencv_contrib \
-lopencv_legacy \
-lopencv_flann
SOURCES += \
program.cpp \
prediction.cpp \
Detection.cpp
HEADERS += \
prediction.h \
Detection.h
The compilation comes out without errors. However when I am running my application I got
./identification: error while loading shared libraries: libopencv_core.so.2.4: cannot open shared object file: No such file or directory
fereres@ubuntu:~/identification-build-desktop-Qt_4_8_1_in_PATH__System__Release$
The /usr/local/lib forlder includes only a python folder I couldn't locate my libs there.
EDIT2: I installed opencv again and now everything is working fine. I guess that the final step of installing opencv didn't work so my /usr/local folder was empty. Now everything is under control.
recognition/program.cpp
line 58 at? – karlphillipusing namespace cv;
? – karlphillip#include
the header, and how the paths were setup inINCLUDEPATH
(assuming they really exist in your machine). – karlphillip