我正在使用支持人臉識別的2.4.7版本的opencv。但是我收到以下錯誤:faceRecognizer未在此範圍內聲明
/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
編輯: 程序的工作,因爲我剛剛更改計算機。我遵循相同的指示來安裝OpenCV。有什麼可以爲這個錯誤負責?我的QT pro文件如下:
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
編譯出來沒有錯誤。然而,當我運行我的應用程序有
./identification: error while loading shared libraries: libopencv_core.so.2.4: cannot open shared object file: No such file or directory
[email protected]:~/identification-build-desktop-Qt_4_8_1_in_PATH__System__Release$
在/ usr/local/lib目錄forlder僅包括一個python文件夾我無法找到我的庫那裏。
EDIT2: 我再次安裝了opencv,現在一切正常。我猜測安裝opencv的最後一步不起作用,所以我的/ usr/local文件夾是空的。現在一切都在掌控之中。
「recognition/program.cpp」第58行代碼在哪裏? – karlphillip
我的第58行:Ptr model; –
當您在順勢療法劑量下提供重要信息時,很難提供幫助。你記得寫'使用命名空間簡介'嗎? – karlphillip