我是在OS X上编译OpenBR的,另外在云主机上编译Qt这种东西简直太坑了!
OpenBR有一个人脸比对的功能,效果还可以,主要是在标数据时候用。
编译过程基本遵循如下:
-
Download and install the latest "XCode" and "Command Line Tools" from the Apple Developer Downloads page.
-
$ cd ~/Downloads $ tar -xf cmake-2.8.11.2.tar.gz $ cd cmake-2.8.11.2 $ ./configure $ make -j4 $ sudo make install $ cd .. $ rm -rf cmake-2.8.11.2*
-
$ cd ~/Downloads $ unzip opencv-2.4.11.zip $ cd opencv-2.4.11 $ mkdir build $ cd build $ cmake -DCMAKE_BUILD_TYPE=Release .. $ make -j4 $ sudo make install $ cd ../.. $ rm -rf opencv-2.4.11*
-
Create a GitHub account, follow their instructions for setting up Git.
$ git clone https://github.com/biometrics/openbr.git
$ cd openbr
$ git checkout 0.5 官方给出的是错的,此处应为:git checkout master
$ git submodule init
$ git submodule update
-
Build OpenBR!
$ mkdir build # from the OpenBR root directory
$ cd build
$ cmake -DCMAKE_PREFIX_PATH=~/Qt/5.4.1/clang_64 -DCMAKE_BUILD_TYPE=Release ..
应为:cmake -DCMAKE_PREFIX_PATH=~/Qt5.4.1/5.4/clang_64 -DCMAKE_BUILD_TYPE=Release -DBR_EMBEDDED=True -DBR_WITH_STASM4=False ..$ make -j4
$ sudo make install
-
Hack OpenBR!
-
Open Qt Creator IDE
$ open ~/Qt/Qt\ Creator.app
应为:
open ~/Qt5.4.1/Qt\ Creator.app/ -
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 "Continue".
- Select "Run CMake" then "Done".
- You're all set! You can find more information on Qt Creator here if you need it.
-
-
(Optional) Test OpenBR!
$ cd openbr/scripts $ ./downloadDatasets.sh $ cd ../build $ make test
-
(Optional) Package OpenBR!
$ cd openbr/build $ sudo cpack -G TGZ
-
(Optional) Build OpenBR documentation!
Need to remake this step with the new docs!
我标红字的地方注意即可。