I'd like to use fisherfaces but currently these funcs are not available; I did a clean cv2 v3.0 install and cmake like so:
cmake -DWITH_QT=ON -DWITH_OPENGL=ON
-DWITH_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=ON .. make clean make -j8 sudo make install
But then don't have access to createfisherfaces as you can see from the tab completion:
In [1]: import cv2
In [3]:> cv2.__version__
Out[3]: '3.0.0'
In [4]: cv2.cre
cv2.createAffineTransformer
cv2.createAlignMTB
cv2.createBackgroundSubtractorKNN
cv2.createBackgroundSubtractorMOG2
cv2.createCLAHE
cv2.createCalibrateDebevec
cv2.createCalibrateRobertson
cv2.createChiHistogramCostExtractor
cv2.createEMDHistogramCostExtractor
cv2.createEMDL1HistogramCostExtractor
cv2.createHanningWindow
cv2.createHausdorffDistanceExtractor
cv2.createLineSegmentDetector
cv2.createMergeDebevec
cv2.createMergeMertens
cv2.createMergeRobertson
cv2.createNormHistogramCostExtractor
cv2.createOptFlow_DualTVL1
cv2.createShapeContextDistanceExtractor
cv2.createStitcher
cv2.createThinPlateSplineShapeTransformer
cv2.createTonemap
cv2.createTonemapDrago
cv2.createTonemapDurand
cv2.createTonemapMantiuk
cv2.createTonemapReinhard
cv2.createTrackbar
I also tried a bunch of cmake variations such as
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=$(python -c "import sys; print(sys.prefix)") -D PYTHON_EXECUTABLE=$(which python) -D BUILD_EXAMPLES=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_TESTS=ON -D BUILD_opencv_java=ON -D WITH_IPP=ON -D OPENCV_EXTRA_MODULES_PATH=/OpenCV/opencv_contrib-3.0.0/modules -D BUILD_NEW_PYTHON_SUPPORT=ON -DWITH_QT=ON -DWITH_OPENGL=ON -DWITH_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=ON ..
I tried git cloning the contrib as per berak's suggestion , and adding the path thereto to the cmake as follows:
jeremy@jrr:~/sw/OpenCV/opencv-3.0.0/build$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_EXAMPLES=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_TESTS=ON -D BUILD_opencv_java=ON -D WITH_IPP=ON -D OPENCV_EXTRA_MODULES_PATH=/home/jeremy/sw/OpenCV/opencv-3.0.0/contrib/opencv_contrib/modules -D BUILD_NEW_PYTHON_SUPPORT=ON -DWITH_QT=ON -DWITH_OPENGL=ON -DWITH_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=ON ..
but this seems to lead to make errors
[ 80%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_perf_xfeatures2d.dir/perf/perf_main.cpp.o
[ 82%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_perf_xfeatures2d.dir/perf/perf_surf.cuda.cpp.o
/home/jeremy/sw/OpenCV/opencv-3.0.0/contrib/opencv_contrib/modules/ximgproc/samples/disparity_filtering.cpp: In function ‘int main(int, char**)’:
/home/jeremy/sw/OpenCV/opencv-3.0.0/contrib/opencv_contrib/modules/ximgproc/samples/disparity_filtering.cpp:170:35: error: ‘MODE_SGBM_3WAY’ is not a member of ‘cv::StereoSGBM’
left_matcher->setMode(StereoSGBM::MODE_SGBM_3WAY);
^
/home/jeremy/sw/OpenCV/opencv-3.0.0/contrib/opencv_contrib/modules/ximgproc/samples/disparity_filtering.cpp:235:30: error: ‘MODE_SGBM_3WAY’ is not a member of ‘cv::StereoSGBM’
matcher->setMode(StereoSGBM::MODE_SGBM_3WAY);
^
make[2]: *** [modules/ximgproc/CMakeFiles/example_ximgproc_disparity_filtering.dir/samples/disparity_filtering.cpp.o] Error 1
make[1]: *** [modules/ximgproc/CMakeFiles/example_ximgproc_disparity_filtering.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 82%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_perf_xfeatures2d.dir/perf/perf_latch.cpp.o
[ 82%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/test/test_rotation_and_scale_invariance.cpp.o
[ 82%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/test/test_main.cpp.o
[ 82%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/test/test_surf.ocl.cpp.o
[ 82%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/test/test_features2d.cpp.o
[ 82%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/test/test_surf.cuda.cpp.o
[ 82%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/test/test_detectors.cpp.o
[ 82%] Building CXX object modules/java/CMakeFiles/opencv_java.dir/bioinspired.cpp.o
[ 82%] Building CXX object modules/java/CMakeFiles/opencv_java.dir/features2d.cpp.o
[ 82%] Building CXX object modules/rgbd/CMakeFiles/opencv_test_rgbd.dir/test/test_utils.cpp.o
Linking CXX executable ../../bin/opencv_perf_xfeatures2d
[ 82%] Building CXX object modules/java/CMakeFiles/opencv_java.dir/calib3d.cpp.o
[ 82%] Built target opencv_perf_xfeatures2d
Linking CXX executable ../../bin/opencv_test_rgbd
Linking CXX executable ../../bin/example_xfeatures2d_bagofwords_classification
[ 82%] Built target opencv_test_rgbd
[ 82%] Built target example_xfeatures2d_bagofwords_classification
Linking CXX executable ../../bin/opencv_test_xfeatures2d
[ 82%] Built target opencv_test_xfeatures2d
Linking CXX shared library ../../lib/libopencv_java300.so
[ 82%] Built target opencv_java
make: *** [all] Error 2
while turning off the legacy also has a make problem
jeremy@jrr:~/sw/OpenCV/opencv-3.0.0/build$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_EXAMPLES=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_TESTS=ON -D BUILD_opencv_java=ON -D WITH_IPP=ON -D OPENCV_EXTRA_MODULES_PATH=/home/jeremy/sw/OpenCV/opencv-3.0.0/contrib/opencv_contrib/modules -D BUILD_NEW_PYTHON_SUPPORT=ON -DWITH_QT=ON -DWITH_OPENGL=ON -DWITH_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=ON -DBUILD_opencv_legacy=OFF ..
...
[ 90%] Built target opencv_test_ximgproc
Linking CXX shared library ../../lib/libopencv_stitching.so
[ 90%] Built target opencv_stitching
make: *** [all] Error 2
ok with berak's guidance this was pretty easy - here is one example of how to get the latest opencv with the 'contrib' libraries (extra libraries such as fisherfaces or other experimental stuff that isn't yet part of the official opencv repository). First get the main opencv code (either thru wget, the web, or git clone - I do clone here as it gets the very latest version) , do the same with the contrib repo, and then do cmake with the -D OPENCV_EXTRA_MODULES_PATH=/path/to/contrib_repo/modules . In particular let's say you want the opencv to sit (in my example /home/jeremy) , then do:
cd /home/jeremy
git clone https://github.com/Itseez/opencv.git
cd opencv
git clone https://github.com/Itseez/opencv_contrib.git
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_EXAMPLES=ON -DINSTALL_C_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON -DOPENCV_EXTRA_MODULES_PATH=/home/jeremy/opencv/opencv_contrib/modules ..
make -j8
make install