diff --git a/openbr/core/common.h b/openbr/core/common.h index 2c6c57c..166ee45 100644 --- a/openbr/core/common.h +++ b/openbr/core/common.h @@ -153,11 +153,10 @@ void MeanStdDev(const V &vals, double *mean, double *stddev) template class C, typename T> T Median(C vals, T *q1 = 0, T *q3 = 0) { - if (vals.isEmpty()) return std::numeric_limits::quiet_NaN(); qSort(vals); - if (q1 != 0) *q1 = vals[1*vals.size()/4]; - if (q3 != 0) *q3 = vals[3*vals.size()/4]; - return vals[vals.size()/2]; + if (q1 != 0) *q1 = vals.isEmpty() ? 0 : vals[1*vals.size()/4]; + if (q3 != 0) *q3 = vals.isEmpty() ? 0 : vals[3*vals.size()/4]; + return vals.isEmpty() ? 0 : vals[vals.size()/2]; } /*! diff --git a/openbr/openbr_export.cpp b/openbr/openbr_export.cpp index 0696346..1bde615 100644 --- a/openbr/openbr_export.cpp +++ b/openbr/openbr_export.cpp @@ -24,7 +24,7 @@ * OpenBR originated within The MITRE Corporation from a need to streamline the process of prototyping new algorithms. * The project was later published as open source software under the Apache 2 license and is free for academic and commercial use. * - * \image html "share/openbr/abstraction.svg" "The two principal software artifacts are the shared library 'openbr' and command line application 'br'." + * \image html "abstraction.svg" "The two principal software artifacts are the shared library 'openbr' and command line application 'br'." * * \section get_started Get Started * - \ref installation - \copybrief installation @@ -45,8 +45,7 @@ * - \subpage windows_msvc * - \subpage windows_mingw * - \subpage osx_clang - * - \subpage linux_gcc - * - \subpage linux_icc + * - \subpage linux_all * * \section installation_from_binary From Binary * Pre-compiled releases are not currently provided, but they can be built from source using the instructions above. @@ -70,13 +69,13 @@ $ export DYLD_FRAMEWORK_PATH=../lib:${DYLD_FRAMEWORK_PATH} * No configuration is necessary! * * \section installation_license_dongle License Dongle - * If you were given a USB License Dongle, then dongle must be in the computer in order to use the SDK. + * In the unlikely event that you were given a USB License Dongle, then dongle must be in the computer in order to use the SDK. * No configuration of the dongle is needed. * * \section installation_done Start Working * To test for successful installation: \verbatim -$ cd bin/ +$ cd bin $ br -help \endverbatim */ @@ -88,17 +87,17 @@ $ br -help * -# You will have to register with Microsoft after installation, but it's free. * -# Grab any available Visual Studio Updates. * -# Download and install Windows 8 SDK. - * -# Download CMake 2.8.10.2 and install. + * -# Download and Install CMake 2.8.10.2 * -# During installation setup select "add CMake to PATH". - * -# Download OpenCV 2.4.4. + * -# Download OpenCV 2.4.5. * -# Consider the free open source program 7-Zip if you need a program to unarchive tarballs. - * -# Move the "OpenCV-2.4.4" folder to "C:\". + * -# Move the "opencv-2.4.5" folder to "C:\". * -# Open "VS2012 x64 Cross Tools Command Prompt" (from the Start Menu, select "All Programs" -> "Microsoft Visual Studio 2012" -> "Visual Studio Tools" -> "VS2012 x64 Cross Tools Command Prompt") and enter: * \code - * $ cd C:\OpenCV-2.4.4 + * $ cd C:\opencv-2.4.5 * $ mkdir build-msvc2012 * $ cd build-msvc2012 - * $ cmake -G "NMake Makefiles" -DBUILD_opencv_java=OFF -DBUILD_opencv_world=ON -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DWITH_FFMPEG=OFF -DCMAKE_BUILD_TYPE=Debug .. + * $ cmake -G "NMake Makefiles" -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DWITH_FFMPEG=OFF -DCMAKE_BUILD_TYPE=Debug .. * $ nmake * $ nmake install * $ cmake -DCMAKE_BUILD_TYPE=Release .. @@ -106,19 +105,7 @@ $ br -help * $ nmake install * $ nmake clean * \endcode - * -# Download Qt 5.0.1 and unzip. - * -# Install Perl/Python/Ruby dependencies as explained in the "Windows" section of "README". Make sure they are added to "path" when given the option during installation. - * -# Download Direct X Software Developement Kit and install. - * -# From the VS2012 x64 Cross Tools Command Prompt: - * \code - * $ cd qt-everywhere-opensource-src-5.0.1 - * $ configure -prefix C:\Qt\5.0.1\msvc2012 -opensource -confirm-license -nomake examples -nomake tests - * $ nmake - * $ nmake install - * $ cd .. - * $ rmdir /Q /S qt-everywhere-opensource-src-5.0.1 - * \endcode - * -# nmake will take several hours to finish. + * -# Download and Install Qt 5.0.2 * -# Create a GitHub account and follow their instructions for setting up Git. * -# Launch "Git Bash" from the Desktop and clone OpenBR: * \code @@ -134,31 +121,30 @@ $ br -help * $ cd C:\openbr * $ mkdir build-msvc2012 * $ cd build-msvc2012 - * $ cmake -G "CodeBlocks - NMake Makefiles" -DCMAKE_PREFIX_PATH="C:/OpenCV-2.4.4/build-msvc2012/install;C:/Qt/5.0.1/msvc2012" -DCMAKE_INSTALL_PREFIX="./install" -DBR_INSTALL_DEPENDENCIES=ON -DCMAKE_BUILD_TYPE=Release .. + * $ cmake -G "CodeBlocks - NMake Makefiles" -DCMAKE_PREFIX_PATH="C:/openCV-2.4.5/build-msvc2012/install;C:/Qt/Qt5.0.2/5.0.2/msvc2012_64" -DCMAKE_INSTALL_PREFIX="./install" -DBR_INSTALL_DEPENDENCIES=ON -DCMAKE_BUILD_TYPE=Release .. * $ nmake * $ nmake install * \endcode * -# Check out the "install" folder. * -# Hack OpenBR! - * -# Download Qt Creator IDE and install. * -# From the VS2012 x64 Cross Tools Command Prompt: * \code - * $ C:\Qt\qtcreator-2.6.2\bin\qtcreator.exe + * $ C:\Qt\Qt5.0.2\Tools\QtCreator\bin\qtcreator.exe * \endcode * -# From the Qt Creator "Tools" menu select "Options..." * -# Under "Kits" select "Desktop (default)" - * -# For "Compiler:" select "Microsoft Visual C++ Compiler 11.0 (amd64)" and click "OK" + * -# For "Compiler:" select "Microsoft Visual C++ Compiler 11.0 (x86_amd64)" and click "OK" * -# From the Qt Creator "File" menu select "Open File or Project...". * -# Select "C:\openbr\CMakeLists.txt" then "Open". - * -# Browse to your prexisting build directory "C:\openbr\build-msvc2012" then select "Next". - * -# Clear any text in the "arguments" box then select "Run CMake" then "Finish". - * -# You're all set! You can find more information on Qt Creator here if you need. + * -# If prompted for the location of CMake, enter "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe". + * -# Browse to your pre-existing build directory "C:\openbr\build-msvc2012" then select "Next". + * -# Select "Run CMake" then "Finish". + * -# You're all set! You can find more information on Qt Creator here if you need. * -# (Optional) Package OpenBR! - * -# Download NSIS 2.46 and install. * -# From the VS2012 x64 Cross Tools Command Prompt: * \code * $ cd C:\openbr\build-msvc2012 - * $ nmake package + * $ cpack -G ZIP * \endcode */ @@ -180,7 +166,7 @@ $ br -help * $ cmake -G "MinGW Makefiles" -DBUILD_opencv_java=OFF -DBUILD_opencv_world=ON -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DWITH_FFMPEG=OFF -DCMAKE_BUILD_TYPE=Debug .. * $ mingw32-make * $ mingw32-make install - * $ cmake -DCMAKE_BUILD_TYPE=Release + * $ cmake -DCMAKE_BUILD_TYPE=Release .. * $ mingw32-make * $ mingw32-make install * $ mingw32-make clean @@ -229,7 +215,7 @@ $ br -help * -# For "Compiler:" select "MinGW (x86 64bit)" and click "OK" * -# From the Qt Creator "File" menu select "Open File or Project...". * -# Select "C:\openbr\CMakeLists.txt" then "Open". - * -# Browse to your prexisting build directory "C:\openbr\build-mingw64" then select "Next". + * -# Browse to your pre-existing build directory "C:\openbr\build-mingw64" then select "Next". * -# Clear any text in the "arguments" box then select "Run CMake" then "Finish". * -# You're all set! You can find more information on Qt Creator here if you need. * -# (Optional) Package OpenBR! @@ -244,7 +230,7 @@ $ br -help /*! * \page osx_clang OS X Mountain Lion - Clang/LLVM 3.1 - x64 * -# Download and install the latest "Xcode" and "Command Line Tools" from the Apple Developer Downloads page. - * -# Download CMake 2.8.10.2. + * -# Download CMake 2.8.10.2 * \code * $ cd ~/Downloads * $ tar -xf cmake-2.8.10.2.tar.gz @@ -253,22 +239,22 @@ $ br -help * $ make -j4 * $ sudo make install * $ cd .. - * $ rm -r cmake-2.8.10.2 + * $ rm -rf cmake-2.8.10.2* * \endcode - * -# Download OpenCV 2.4.4. + * -# Download OpenCV 2.4.5 * \code * $ cd ~/Downloads - * $ tar -xf OpenCV-2.4.4.tar.bz2 - * $ cd OpenCV-2.4.4 + * $ tar -xf opencv-2.4.5.tar.gz + * $ cd opencv-2.4.5 * $ mkdir build * $ cd build - * $ cmake -DBUILD_opencv_java=OFF -DBUILD_opencv_world=OFF -DCMAKE_BUILD_TYPE=Release .. + * $ cmake -DCMAKE_BUILD_TYPE=Release .. * $ make -j4 * $ sudo make install * $ cd ../.. - * $ rm -r OpenCV-2.4.4 + * $ rm -rf opencv-2.4.5* * \endcode - * -# Download Qt 5.0.1 and install. + * -# Download and install Qt 5.0.2 * -# Create a GitHub account, follow their instructions for setting up Git. * \code * $ git clone https://github.com/biometrics/openbr.git @@ -278,30 +264,36 @@ $ br -help * \endcode * -# Build OpenBR! * \code - * $ cd openbr - * $ mkdir build + * $ mkdir build # from the OpenBR root directory * $ cd build - * $ cmake -DCMAKE_PREFIX_PATH=~/Qt5.0.1/5.0.1/clang_64 -DCMAKE_BUILD_TYPE=Release .. + * $ cmake -DCMAKE_PREFIX_PATH=~/Qt5.0.2/5.0.2/clang_64 -DCMAKE_BUILD_TYPE=Release .. * $ make -j4 * $ sudo make install * \endcode * -# Hack OpenBR! * -# Open Qt Creator IDE * \code - * $ open ~/Qt5.0.1/Qt\ Creator.app + * $ open ~/Qt5.0.2/Qt\ Creator.app * \endcode * -# From the Qt Creator "File" menu select "Open File or Project...". - * -# Select "~/openbr/CMakeLists.txt" then "Open". - * -# Browse to your prexisting build directory "~/openbr/build" then select "Continue". + * -# 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. + * -# (Optional) Test OpenBR! + * \code + * $ cd openbr/scripts + * $ ./downloadDatasets.sh + * $ cd ../build + * $ make test + * \endcode * -# (Optional) Package OpenBR! * \code * $ cd openbr/build - * $ make package + * $ sudo cpack -G TGZ * \endcode * -# (Optional) Build OpenBR documentation! - * -# Download Doxygen 1.8.2 and install: + * -# Download Doxygen 1.8.2 * \code * $ cd ~/Downloads * $ tar -xf doxygen-1.8.2.src.tar.gz @@ -310,9 +302,9 @@ $ br -help * $ make -j4 * $ sudo make install * $ cd .. - * $ rm -r doxygen-1.8.2 + * $ rm -rf doxygen-1.8.2* * \endcode - * -# Modify build settings and recompile: + * -# Modify build settings and recompile. * \code * $ cd openbr/build * $ cmake -DBR_BUILD_DOCUMENTATION=ON .. @@ -322,42 +314,33 @@ $ br -help */ /*! - * \page linux_gcc Ubuntu 12.04 LTS - GCC 4.6.3 - x64 - * -# Install GCC 4.6.3. + * \page linux_all Ubuntu 13.04 - GCC 4.7.3 or ICC 13.1.1 - x64 + * -# Install GCC 4.7.3 * \code * $ sudo apt-get update * $ sudo apt-get install build-essential * \endcode - * -# Download CMake 2.8.10.2. + * -# (Optional) Assuming you meet the eligibility requirements and you want to use ICC instead of GCC, Download and Install Intel C++ Studio XE 2013. + * -# Install CMake 2.8.10.1 * \code - * $ cd ~/Downloads - * $ tar -xf cmake-2.8.10.2.tar.gz - * $ cd cmake-2.8.10.2 - * $ ./configure - * $ make -j4 - * $ sudo make install - * $ cd .. - * $ rm -r cmake-2.8.10.2 + * $ sudo apt-get install cmake cmake-curses-gui * \endcode - * -# Download OpenCV 2.4.4. + * -# Download OpenCV 2.4.5 * \code * $ cd ~/Downloads - * $ tar -xf OpenCV-2.4.4.tar.bz2 - * $ cd OpenCV-2.4.4 + * $ tar -xf opencv-2.4.5.tar.gz + * $ cd opencv-2.4.5 * $ mkdir build * $ cd build - * $ cmake -DBUILD_opencv_java=OFF -DBUILD_opencv_world=ON -DCMAKE_BUILD_TYPE=Release .. + * $ cmake -DCMAKE_BUILD_TYPE=Release .. * $ make -j4 * $ sudo make install * $ cd ../.. - * $ rm -r OpenCV-2.4.4 + * $ rm -rf opencv-2.4.5* * \endcode - * -# Download Qt 5.0.1. + * -# Install Qt 5.0.1 * \code - * $ cd ~/Downloads - * $ chmod +x qt-linux-opensource-5.0.1-x86_64-offline.run - * $ ./qt-linux-opensource-5.0.1-x86_64-offline.run - * $ rm qt-linux-opensource-5.0.1-x86_64-offline.run + * $ sudo apt-get install qt5-default libqt5svg5-dev qtcreator * \endcode * -# Create a GitHub account, follow their instructions for setting up Git. * \code @@ -368,94 +351,43 @@ $ br -help * \endcode * -# Build OpenBR! * \code - * $ cd openbr - * $ mkdir build + * $ mkdir build # from the OpenBR root directory * $ cd build - * $ cmake -DCMAKE_PREFIX_PATH=~/Qt5.0.1/5.0.1/gcc_64 -DCMAKE_BUILD_TYPE=Release .. + * $ cmake -DCMAKE_BUILD_TYPE=Release .. # GCC Only + * $ cmake -DCMAKE_C_COMPILER=/opt/intel/bin/icc -DCMAKE_CXX_COMPILER=/opt/intel/bin/icpc -DCMAKE_BUILD_TYPE=Release .. # ICC Only * $ make -j4 * $ sudo make install * \endcode * -# Hack OpenBR! * -# Open Qt Creator IDE * \code - * $ ~/Qt5.0.1/Tools/QtCreator/bin/qtcreator & + * $ qtcreator & * \endcode * -# From the Qt Creator "File" menu select "Open File or Project...". - * -# Select "~/openbr/CMakeLists.txt" then "Open". - * -# Browse to your prexisting build directory "~/openbr/build" then select "Next". + * -# 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 if you need. - * -# (Optional) Package OpenBR! - * \code - * $ cd openbr/build - * $ make package - * \endcode - */ - -/*! - * \page linux_icc Ubuntu 12.04 LTS - Intel C++ Studio XE 2013 - x64 - * -# Assuming you meet the eligibility requirements, Download Intel C++ Studio XE 2013 and install. - * -# Download CMake 2.8.10.2. - * \code - * $ cd ~/Downloads - * $ tar -xf cmake-2.8.10.2.tar.gz - * $ cd cmake-2.8.10.2 - * $ ./configure - * $ make -j4 - * $ sudo make install - * $ cd .. - * $ rm -r cmake-2.8.10.2 - * \endcode - * -# Download OpenCV 2.4.4. - * \code - * $ cd ~/Downloads - * $ tar -xf OpenCV-2.4.4.tar.bz2 - * $ cd OpenCV-2.4.4 - * $ mkdir build - * $ cd build - * $ cmake cmake -DBUILD_opencv_java=OFF -DBUILD_opencv_world=ON -DCMAKE_BUILD_TYPE=Release .. - * $ make -j4 - * $ sudo make install - * $ cd ../.. - * $ rm -r OpenCV-2.4.4 - * \endcode - * -# Download Qt 5.0.1. - * \code - * $ cd ~/Downloads - * $ chmod +x qt-linux-opensource-5.0.1-x86_64-offline.run - * $ ./qt-linux-opensource-5.0.1-x86_64-offline.run - * $ rm qt-linux-opensource-5.0.1-x86_64-offline.run - * \endcode - * -# Create a GitHub account, follow their instructions for setting up Git. + * -# You're all set! You can find more information on Qt Creator here if you need. + * -# (Optional) Test OpenBR! * \code - * $ git clone https://github.com/biometrics/openbr.git - * $ cd openbr - * $ git submodule init - * $ git submodule update + * $ cd openbr/scripts + * $ ./downloadDatasets.sh + * $ cd ../build + * $ make test * \endcode - * -# Build OpenBR! + * -# (Optional) Package OpenBR! * \code - * $ cd openbr - * $ mkdir build-icc - * $ cd build-icc - * $ cmake -DCMAKE_C_COMPILER=/opt/intel/bin/icc -DCMAKE_CXX_COMPILER=/opt/intel/bin/icpc -DCMAKE_PREFIX_PATH=~/Qt5.0.1/5.0.1/gcc_64 -DCMAKE_BUILD_TYPE=Release .. - * $ make -j4 - * $ sudo make install + * $ cd openbr/build + * $ sudo cpack -G TGZ * \endcode - * -# Hack OpenBR! - * -# Open Qt Creator IDE - * \code - * $ ~/Qt5.0.1/Tools/QtCreator/bin/qtcreator & - * \endcode - * -# From the Qt Creator "File" menu select "Open File or Project...". - * -# Select "~/openbr/CMakeLists.txt" then "Open". - * -# Browse to your prexisting 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 if you need. - * -# (Optional) Package OpenBR! + * -# (Optional) Build OpenBR documentation! * \code + * $ sudo apt-get install doxygen * $ cd openbr/build - * $ make package + * $ cmake -DBR_BUILD_DOCUMENTATION=ON .. + * $ make -j4 + * $ sudo apt-get install libgnome2-bin + * $ gnome-open html/index.html * \endcode */ diff --git a/openbr/openbr_plugin.cpp b/openbr/openbr_plugin.cpp index 7579e75..a1ca2f0 100644 --- a/openbr/openbr_plugin.cpp +++ b/openbr/openbr_plugin.cpp @@ -425,8 +425,6 @@ TemplateList TemplateList::fromGallery(const br::File &gallery) if (crossValidate > 0) srand(0); for (int i=newTemplates.size()-1; i>=0; i--) { - newTemplates[i].file.append(gallery.localMetadata()); - newTemplates[i].file.append(file.localMetadata()); newTemplates[i].file.set("Index", i+templates.size()); newTemplates[i].file.set("Gallery", gallery.name); diff --git a/share/openbr/Doxyfile.in b/share/openbr/Doxyfile.in index 22c56b8..26151d7 100644 --- a/share/openbr/Doxyfile.in +++ b/share/openbr/Doxyfile.in @@ -755,7 +755,7 @@ EXAMPLE_RECURSIVE = YES # directories that contain image that are included in the documentation (see # the \image command). -IMAGE_PATH = ${CMAKE_SOURCE_DIR} +IMAGE_PATH = ${CMAKE_SOURCE_DIR}/share/openbr # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program diff --git a/share/openbr/cmake/InstallDependencies.cmake b/share/openbr/cmake/InstallDependencies.cmake index a2dd623..fbcca17 100644 --- a/share/openbr/cmake/InstallDependencies.cmake +++ b/share/openbr/cmake/InstallDependencies.cmake @@ -33,7 +33,7 @@ function(install_qt_library lib) if(${CMAKE_BUILD_TYPE} MATCHES Debug) set(BR_INSTALL_DEPENDENCIES_SUFFIX "d") endif() - install(FILES ${_qt5Core_install_prefix}/lib/Qt5${lib}${BR_INSTALL_DEPENDENCIES_SUFFIX}.dll DESTINATION bin) + install(FILES ${_qt5Core_install_prefix}/bin/Qt5${lib}${BR_INSTALL_DEPENDENCIES_SUFFIX}.dll DESTINATION bin) elseif(CMAKE_HOST_APPLE) install(DIRECTORY ${_qt5Core_install_prefix}/lib/Qt${lib}.framework DESTINATION lib) else()