2017-07-02 7 views
2

openCVを使用してC++でfacerecognizerを作成しようとしています。 ()を作成:: FisherFaceRecognizer ::C++ openCV - createFisherFaceRecognizerがこのスコープで宣言されていません

main.cpp:(.text+0x6a8): undefined reference to`cv::face::createFisherFaceRecognizer(int, double)' 

2)顔が、:

1)のcv ::顔:: createFisherFaceRecognizer(int型、ダブル)が、これは与える:しかし、次のエラーを得続けますこれは与えていない:これらの作業の

error: ‘cv::face::FisherFaceRecognizer’ has not been declared 

どれも、私はmy code実行できません正しい方法(働いていたものをコメント行のどれも...)何ですか?

誰も私を助けなかったので、私はすべてを再インストールしました。

General configuration for OpenCV 3.2.0 ===================================== 
    Version control:    unknown 

    Extra modules: 
    Location (extra):   /home/yalishanda/Downloads/opencv_contrib-3.2.0/modules 
    Version control (extra):  unknown 

    Platform: 
    Timestamp:     2017-07-04T08:29:50Z 
    Host:      Linux 4.8.0-36-generic x86_64 
    CMake:      3.5.1 
    CMake generator:    Unix Makefiles 
    CMake build tool:   /usr/bin/make 
    Configuration:    Release 

    C/C++: 
    Built as dynamic libs?:  YES 
    C++ Compiler:    /usr/bin/c++ (ver 5.4.0) 
    C++ flags (Release):   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG 
    C++ flags (Debug):   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG 
    C Compiler:     /usr/bin/cc 
    C flags (Release):   -fsigned-char -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 -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG 
    C flags (Debug):    -fsigned-char -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 -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG 
    Linker flags (Release): 
    Linker flags (Debug): 
    ccache:      NO 
    Precompiled headers:   YES 
    Extra dependencies:   /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libz.so gtk-x11-2.0 gdk-x11-2.0 pangocairo-1.0 atk-1.0 cairo gdk_pixbuf-2.0 gio-2.0 pangoft2-1.0 pango-1.0 gobject-2.0 fontconfig freetype gthread-2.0 glib-2.0 dl m pthread rt 
    3rdparty dependencies:  libjpeg libwebp libtiff libjasper IlmImf libprotobuf 

    OpenCV modules: 
    To be built:     core flann imgproc ml photo reg surface_matching video dnn freetype fuzzy imgcodecs shape videoio highgui objdetect plot superres ts xobjdetect xphoto bgsegm bioinspired dpm face features2d line_descriptor saliency text calib3d ccalib datasets rgbd stereo tracking videostab xfeatures2d ximgproc aruco optflow phase_unwrapping stitching structured_light 
    Disabled:     world contrib_world 
    Disabled by dependency:  - 
    Unavailable:     cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz cnn_3dobj cvv hdf matlab sfm 

    GUI: 
    QT:       NO 
    GTK+ 2.x:     YES (ver 2.24.30) 
    GThread :     YES (ver 2.48.2) 
    GtkGlExt:     NO 
    OpenGL support:    NO 
    VTK support:     NO 

    Media I/O: 
    ZLib:      /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.8) 
    JPEG:      libjpeg (ver 90) 
    WEBP:      build (ver 0.3.1) 
    PNG:       /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.54) 
    TIFF:      build (ver 42 - 4.0.2) 
    JPEG 2000:     build (ver 1.900.1) 
    OpenEXR:      build (ver 1.7.1) 
    GDAL:      NO 
    GDCM:      NO 

    Video I/O: 
    DC1394 1.x:     NO 
    DC1394 2.x:     NO 
    FFMPEG:      NO 
     avcodec:     NO 
     avformat:     NO 
     avutil:     NO 
     swscale:     NO 
     avresample:    NO 
    GStreamer:     NO 
    OpenNI:      NO 
    OpenNI PrimeSensor Modules: NO 
    OpenNI2:      NO 
    PvAPI:      NO 
    GigEVisionSDK:    NO 
    Aravis SDK:     NO 
    UniCap:      NO 
    UniCap ucil:     NO 
    V4L/V4L2:     NO/YES 
    XIMEA:      NO 
    Xine:      NO 
    gPhoto2:      NO 

    Parallel framework:   pthreads 

    Other third-party libraries: 
    Use IPP:      9.0.1 [9.0.1] 
     at:      /home/yalishanda/Downloads/opencv-3.2.0/build/3rdparty/ippicv/ippicv_lnx 
    Use IPP Async:    NO 
    Use VA:      NO 
    Use Intel VA-API/OpenCL:  NO 
    Use Lapack:     NO 
    Use Eigen:     NO 
    Use Cuda:     NO 
    Use OpenCL:     YES 
    Use OpenVX:     NO 
    Use custom HAL:    NO 

    OpenCL:      <Dynamic loading of OpenCL library> 
    Include path:    /home/yalishanda/Downloads/opencv-3.2.0/3rdparty/include/opencl/1.2 
    Use AMDFFT:     NO 
    Use AMDBLAS:     NO 

    Python 2: 
    Interpreter:     /usr/bin/python2.7 (ver 2.7.12) 

    Python 3: 
    Interpreter:     /usr/bin/python3 (ver 3.5.2) 

    Python (for build):   /usr/bin/python2.7 

    Java: 
    ant:       NO 
    JNI:       NO 
    Java wrappers:    NO 
    Java tests:     NO 

    Matlab:      Matlab not found or implicitly disabled 

    Documentation: 
    Doxygen:      NO 

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

    Install path:     /usr/local 

    cvconfig.h is in:    /home/yalishanda/Downloads/opencv-3.2.0/build 
----------------------------------------------------------------- 

これは私がコンパイルされてコマンドは次のとおりです:これは、現在の状況で、既にOpenCVの中に存在するほぼすべてのライブラリをリンク話すの(https://pastebin.com/raw/1EB7jXZd

g++ src/faceDetection.cpp src/faceRecognition.cpp main.cpp -L/usr/local/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dpm -lopencv_fuzzy -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_rgbd -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_plot -lopencv_dnn -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_photo -lopencv_imgproc -lopencv_core -o main 

ソート....他に何私は追加できますか?

+0

OpenCVのどのバージョンですか?あなたは2.4.xのドキュメントを参照していますが、私はあなたが3.xを使用している疑いがあります。 –

+0

@DanMašekは確かに間違ったドキュメントを見ていました。しかし、私が3.1の文書に従えば、私はまったく同じエラーになります...何をお勧めしますか? – LandonZeKepitelOfGreytBritn

+0

これらのドキュメントは最新のものではないと思われます。ソースコードを見ると、私は[これ](https://github.com/opencv/opencv_contrib/blob/master/modules/face/include/opencv2/face/facerec.hpp#L122)があなたの望むものだと思います。 –

答えて

0

createFisherFaceRecognizer()は、使用する前に宣言する必要があります。ほとんどの場合、ヘッダーファイル(.h)がありません。私はそれがどれであるかを医者から理解できませんでした。あなたはこの関数を宣言しているものを見つける必要があります。

+0

ありがとう、私はすでに自分自身も考えています。しかし私はどちらも知らない。残念ながら、あなたの答えは解決策ではありません。 – LandonZeKepitelOfGreytBritn

関連する問題