diff --git a/CMakeLists.txt b/CMakeLists.txt index 62899a6..a890f90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,7 @@ set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${Qt5Core_QTMAIN_LIBRARIES}) # Find OpenCV find_package(OpenCV REQUIRED) -set(OPENCV_DEPENDENCIES opencv_core opencv_features2d opencv_flann opencv_highgui opencv_imgproc opencv_ml opencv_nonfree opencv_objdetect opencv_photo) +set(OPENCV_DEPENDENCIES opencv_core opencv_features2d opencv_flann opencv_gpu opencv_highgui opencv_imgproc opencv_ml opencv_nonfree opencv_objdetect opencv_photo) set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${OpenCV_LIBS}) # Find Alphanum diff --git a/openbr/core/bee.cpp b/openbr/core/bee.cpp index 1792fbd..a513b74 100644 --- a/openbr/core/bee.cpp +++ b/openbr/core/bee.cpp @@ -107,8 +107,6 @@ void BEE::writeSigset(const QString &sigset, const br::FileList &files, bool ign template Mat readMatrix(const br::File &matrix, QString *targetSigset = NULL, QString *querySigset = NULL) { - qDebug() << matrix; - // Special case matrix construction if (matrix == "Identity") { int rows = matrix.get("rows", -1); @@ -163,9 +161,6 @@ Mat readMatrix(const br::File &matrix, QString *targetSigset = NULL, QString *qu int rows = words[1].toInt(); int cols = words[2].toInt(); - qDebug() << rows; - qDebug() << cols; - // Get matrix data qint64 bytesExpected = (qint64)rows*(qint64)cols*(qint64)sizeof(T); Mat m(rows, cols, OpenCVType::make()); diff --git a/openbr/openbr_export.cpp b/openbr/openbr_export.cpp index 1bde615..a0d2138 100644 --- a/openbr/openbr_export.cpp +++ b/openbr/openbr_export.cpp @@ -28,6 +28,7 @@ * * \section get_started Get Started * - \ref installation - \copybrief installation + * - \ref qmake_integration - \copybrief qmake_integration * * \section learn_more Learn More * - \ref cli - \copybrief cli @@ -57,7 +58,7 @@ $ cd bin $ export LD_LIBRARY_PATH=../lib:${LD_LIBRARY_PATH} $ sudo ldconfig -$ sudo cp ../share/70-yubikey.rules /etc/udev/rules.d # Only needed if you were given a license dongle. +$ sudo cp ../share/openbr/70-yubikey.rules /etc/udev/rules.d # Only needed if you were given a license dongle. \endverbatim * \par OS X \verbatim @@ -89,7 +90,7 @@ $ br -help * -# Download and install Windows 8 SDK. * -# Download and Install CMake 2.8.10.2 * -# During installation setup select "add CMake to PATH". - * -# Download OpenCV 2.4.5. + * -# 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.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: @@ -150,20 +151,20 @@ $ br -help /*! * \page windows_mingw Windows 7 - MinGW-w64 2.0 - x64 - * -# Download MinGW-w64 GCC 4.7.2 and unarchive. + * -# Download and Unarchive MinGW-w64 GCC 4.7.2 * -# Use the free open source program 7-Zip to unarchive. * -# Move "x86_64-w64-mingw32-gcc-4.7.2-release-win64_rubenvb\mingw64" to "C:\". - * -# 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:\". * -# From the MinGW-w64 Command Prompt (double-click "C:\mingw64\mingw64env.cmd"): * \code - * $ cd C:\OpenCV-2.4.4 + * $ cd C:\opencv-2.4.5 * $ mkdir build-mingw64 * $ cd build-mingw64 - * $ 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 .. + * $ cmake -G "MinGW Makefiles" -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DWITH_FFMPEG=OFF -DCMAKE_BUILD_TYPE=Debug .. * $ mingw32-make * $ mingw32-make install * $ cmake -DCMAKE_BUILD_TYPE=Release .. @@ -171,17 +172,17 @@ $ br -help * $ mingw32-make install * $ mingw32-make clean * \endcode - * -# Download Qt 5.0.1 and unzip. + * -# Download and Unzip Qt 5.0.2 * -# 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. You may also need to install the latest OpenGL drivers from your graphics card manufacturer. + * -# Download and Install Direct X Software Developement Kit, you may also need to install the latest OpenGL drivers from your graphics card manufacturer. * -# From the MinGW-w64 Command Prompt: * \code - * $ cd qt-everywhere-opensource-src-5.0.1 - * $ configure -prefix C:\Qt\5.0.1\mingw64 -opensource -confirm-license -nomake examples -nomake tests -opengl desktop + * $ cd qt-everywhere-opensource-src-5.0.2 + * $ configure -prefix C:\Qt\Qt5.0.2\5.0.2\mingw64 -opensource -confirm-license -nomake examples -nomake tests -opengl desktop * $ mingw32-make * $ mingw32-make install * $ cd .. - * $ rmdir /Q /S qt-everywhere-opensource-src-5.0.1 + * $ rmdir /Q /S qt-everywhere-opensource-src-5.0.2 * \endcode * -# mingw32-make will take several hours to finish. * -# Create a GitHub account and follow their instructions for setting up Git. @@ -199,31 +200,30 @@ $ br -help * $ cd C:\openbr * $ mkdir build-mingw64 * $ cd build-mingw64 - * $ cmake -G "CodeBlocks - MinGW Makefiles" -DCMAKE_RC_COMPILER="C:/mingw64/bin/windres.exe" -DCMAKE_PREFIX_PATH="C:/OpenCV-2.4.4/build-mingw64/install;C:/Qt/5.0.1/mingw64" -DCMAKE_INSTALL_PREFIX="./install" -DBR_INSTALL_DEPENDENCIES=ON -DCMAKE_BUILD_TYPE=Release .. + * $ cmake -G "CodeBlocks - MinGW Makefiles" -DCMAKE_RC_COMPILER="C:/mingw64/bin/windres.exe" -DCMAKE_PREFIX_PATH="C:/opencv-2.4.5/build-mingw64/install;C:/Qt/Qt5.0.2/5.0.2/mingw64" -DCMAKE_INSTALL_PREFIX="./install" -DBR_INSTALL_DEPENDENCIES=ON -DCMAKE_BUILD_TYPE=Release .. * $ mingw32-make * $ mingw32-make install * \endcode * -# Check out the "install" folder. * -# Hack OpenBR! - * -# Download Qt Creator IDE and install. * -# From the MinGW-w64 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 "MinGW (x86 64bit)" and click "OK" + * -# For "Compiler:" select "MinGW (x86 64bit in C:\mingw64\bin)" and click "OK" * -# From the Qt Creator "File" menu select "Open File or Project...". * -# Select "C:\openbr\CMakeLists.txt" then "Open". + * -# 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-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. + * -# 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 MinGW-w64 Command Prompt: * \code * $ cd C:\openbr\build-mingw64 - * $ mingw32-make package + * $ cpack -G ZIP * \endcode */ @@ -392,6 +392,15 @@ $ br -help */ /*! + * \page qmake_integration QMake Integration + * \brief Add OpenBR to your Qt .pro project. + * + * After completing the \ref installation instructions, try launching Qt Creator and opening \/share/openbr/qmake_tutorial/hello.pro. + * + * Happy hacking! + */ + +/*! * \page bee Biometric Evaluation Environment * \brief The Biometric Evaluation Environment (BEE) is a NIST standard for evaluating biometric algorithms. * diff --git a/openbr/plugins/eigen3.cmake b/openbr/plugins/eigen3.cmake index cc7e257..ed6a3e2 100644 --- a/openbr/plugins/eigen3.cmake +++ b/openbr/plugins/eigen3.cmake @@ -3,5 +3,5 @@ set(BR_WITH_EIGEN3 ON CACHE BOOL "Build Eigen3 plugins") if(${BR_WITH_EIGEN3}) find_package(Eigen3 REQUIRED) set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} plugins/eigen3.cpp) - install(FILES ${EIGEN3_LICENSE} RENAME Eigen3.license DESTINATION .) + install(FILES ${EIGEN3_LICENSE} RENAME Eigen3 DESTINATION share/openbr/licenses) endif() diff --git a/openbr/plugins/mongoose.cmake b/openbr/plugins/mongoose.cmake index dee8326..a32ea7d 100644 --- a/openbr/plugins/mongoose.cmake +++ b/openbr/plugins/mongoose.cmake @@ -2,5 +2,5 @@ set(BR_WITH_MONGOOSE OFF CACHE BOOL "Build with Mongoose") if(${BR_WITH_MONGOOSE}) find_package(Mongoose) set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} plugins/mongoose.cpp ${MONGOOSE_SRC}) - install(FILES ${MONGOOSE_LICENSE} RENAME mongoose.license DESTINATION .) + install(FILES ${MONGOOSE_LICENSE} RENAME mongoose DESTINATION share/openbr/licenses) endif() diff --git a/openbr/plugins/qtnetwork.cmake b/openbr/plugins/qtnetwork.cmake index a85e923..e2b5b3d 100644 --- a/openbr/plugins/qtnetwork.cmake +++ b/openbr/plugins/qtnetwork.cmake @@ -4,5 +4,5 @@ if(${BR_WITH_QTNETWORK}) find_package(HttpParser) set(QT_DEPENDENCIES ${QT_DEPENDENCIES} Network) set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} plugins/qtnetwork.cpp ${HTTPPARSER_SRC}) - install(FILES ${HTTPPARSER_LICENSE} RENAME http-parser.license DESTINATION .) + install(FILES ${HTTPPARSER_LICENSE} RENAME http-parser DESTINATION share/openbr/license) endif() diff --git a/openbr/plugins/yubico.cmake b/openbr/plugins/yubico.cmake index 913f855..8273747 100644 --- a/openbr/plugins/yubico.cmake +++ b/openbr/plugins/yubico.cmake @@ -4,9 +4,9 @@ if(${BR_WITH_YUBICO}) find_package(YubiKey REQUIRED) # For decrypting YubiKeys find_package(YKPers REQUIRED) # For reading YubiKeys - install(FILES ${YUBIKEY_LICENSE} DESTINATION doc RENAME YubiKey.license) - install(FILES ${YKPERS_LICENSE} DESTINATION doc RENAME YKPers.license) - install(FILES ${YKPERS_RULES} DESTINATION share) + install(FILES ${YUBIKEY_LICENSE} RENAME YubiKey DESTINATION share/openbr/licenses) + install(FILES ${YKPERS_LICENSE} RENAME YKPers DESTINATION share/openbr/licenses) + install(FILES ${YKPERS_RULES} DESTINATION share/openbr) set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} ${YUBIKEY_SRC} ${YKPERS_SRC} plugins/yubico.cpp) set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${YKPERS_LIBS}) diff --git a/share/openbr/matlab/loadBin.m b/share/openbr/matlab/loadBin.m deleted file mode 100644 index 91afb95..0000000 --- a/share/openbr/matlab/loadBin.m +++ /dev/null @@ -1,25 +0,0 @@ -function [x2] = loadBin(filename,reverse) -% [x2] = loadBin(filename,reverse) - - if nargin < 2, - reverse = false; - end - - z = fopen(filename,'r'); - if z == -1, - fprintf('Error opening file %s\n',filename); - x2 = 0; - return - end - - x = fread(z,1,'int32'); - x1 = fread(z,1,'int32'); - x2 = fread(z,[x1 x],'float32'); - x2 = x2'; - fclose(z); - - if reverse, - sz = size(x2); - x2 = x2'; - x2 = reshape(x2,sz); - end diff --git a/share/openbr/matlab/loadMtx.m b/share/openbr/matlab/loadMtx.m deleted file mode 100644 index f0b016a..0000000 --- a/share/openbr/matlab/loadMtx.m +++ /dev/null @@ -1,59 +0,0 @@ -function [x2] = loadMtx(filename,isRowMajor) -% [x2] = loadMtx(filename,reverse) -% -% Loads a *.mtx file into a Matlab matrix. -% 'filename' - the name of the mtx file -% 'isRowMajor' - determines whether the -% matrix is read in row major or -% column major order (optional, default is false) -% -% This file can likely be improved in terms of effeciency. - - - if nargin < 2, - reverse = false; - end - - z = fopen(filename,'r'); - if z == -1, - fprintf('Error opening file %s\n',filename); - x2 = 0; - return - end - - buf = zeros(100,1); - str_list = cell(4,1); - for i = 1:4, - cnt = 0; - while true - cnt = cnt + 1; - [a ] = fread(z,1,'uchar'); - if a == 10 - break; - end - buf(cnt) = a; - end - str_list{i} = char(buf(1:cnt-1)'); - end - - s = strsplit(' ',str_list{4}); - x = str2num(s{2}); - x1 = str2num(s{3}); - typ = s{1}(2); - - %x2 = fread(z,[x1 x],'float32'); - if strcmp(typ,'F') - x2 = fread(z,[x1 x],'single'); - elseif strcmp(typ,'B') - x2 = fread(z,[x1 x],'int8'); - else - assert(0); - end - x2 = x2'; - fclose(z); - - if reverse, - sz = size(x2); - x2 = x2'; - x2 = reshape(x2,sz); - end \ No newline at end of file diff --git a/share/openbr/qmake_tutorial/hello.pro b/share/openbr/qmake_tutorial/hello.pro new file mode 100644 index 0000000..4c0494b --- /dev/null +++ b/share/openbr/qmake_tutorial/hello.pro @@ -0,0 +1,6 @@ +QT += widgets + +INCLUDEPATH += ../../../include +LIBS += -L../../../lib -lopenbr + +SOURCES = main.cpp diff --git a/share/openbr/qmake_tutorial/main.cpp b/share/openbr/qmake_tutorial/main.cpp new file mode 100644 index 0000000..e0864bb --- /dev/null +++ b/share/openbr/qmake_tutorial/main.cpp @@ -0,0 +1,17 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + br_initialize(argc, argv); + + QLabel label; + label.setText("Hello OpenBR!"); + label.show(); + + int result = app.exec(); + br_finalize(); + return result; +}