翻译来源:http://www.cnblogs.com/spaceship9/p/4096383.html
OpenBR 是一个很好的人脸检测(facial detecting)工程。
System:linuxmint 13 X86_64
人脸识别、表情/性别/年龄/检测
website:
github:
警告:
只需要尝试下面比较酷的东西,安装教程:http://openbiometrics.org/doxygen/latest/installation.html
但是由于lib/package的原因上面教程是针对Ubuntu13.04的。
结论:你需要安装或处理一系列的libs/packages在你编译openbr之前。
准备(Materials):
(1)cmake(版本高于2.8.11)
(2)QT5(版本高于5.0)
(3)opencv sources files and libs
step1、编译cmake(compiling cmake)
git clone https://github.com/Kitware/CMake cd CMake ./configure --prefix=/usr/local make make install ldconfig
step2、安装QT5(installing QT
wget -c http://download.qt-project.org/official_releases/qt/5.3/5.3.2/qt-opensource-linux-x64-5.3.2.run chmod +x qt-opensource-linux-x64-5.3.2.run sudo ./qt-opensource-linux-x64-5.3.2.run # Then a wizard window would jump out, install it as you wish . # By default a /opt/Qt5.3.2/ will be the default directory
step3、编译opencv(building opencv)
(注意:openbr 0.5或更早版本不能工作在opencv3.0+上。如果用opencv3.0+编译openbr,openbr将会报出如下错误)
In file included from /usr/local/src/openbr/build/stasm/src/external_stasm/stasm/stasm/src/stasm_lib.cpp:7:0: /usr/local/src/openbr/build/stasm/src/external_stasm/stasm/stasm/include/misc.h:422:1: error: ‘CvScalar’ does not name a type make[5]: *** [stasm/CMakeFiles/stasm.dir/stasm/src/stasm_lib.cpp.o] Error 1 make[4]: *** [stasm/CMakeFiles/stasm.dir/all] Error 2 make[3]: *** [all] Error 2 make[2]: *** [stasm/src/external_stasm-stamp/external_stasm-build] Error 2 make[1]: *** [openbr/CMakeFiles/external_stasm.dir/all] Error 2 make: *** [all] Error 2
所以,我们需要安装opencv2.4.9。下载链接http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip/download
unzip opencv-2.4.9.zip -d /usr/local/src # or the path you store source files cd /usr/local/src/opencv-2.4.9/ # Then use 'cmake' to compile opencv sources mkdir release cd release cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. # # Notice when building, cmake would look for some 3rdparty modules from internet. If you see something "-- ICV: Downloading ippicv_linux_20141027.tgz... " , do not be panic, take your time. A cup of coffee is calling you :) sudo make sudo make install
step4、编译openbr(building openbr)——更新的cmake,跨平台的QT5,匹配的opencv
git clone https://github.com/biometrics/openbr.git cd openbr git checkout master # Or here git checkout 0.5 ## coz some times master changes a lot LOL git submodule init git submodule update # It will cost your minutes to download those sub-modules. Take that easy. # Then, try to build the openbr sudo cmake -DCMAKE_PREFIX_PATH=/opt/Qt5.3.2/5.3/gcc_64 -DOpenCV_DIR=/usr/local/src/opencv-2.4.9/release -DCMAKE_BUILD_TYPE=Release .. sudo make j4 sudo make install
Hack OpenBR! Open Qt Creator IDE $ qtcreator & From the Qt Creator "File" menu select "Open File or Project...". Select "openbr/CMakeLists.txt" then "Open". Browse to your pre-existing build directory "openbr/build" then select "Next". Select "Run CMake" then "Finish". You're all set! You can find more information on Qt Creator here http://qt-project.org/doc/qtcreator if you need.