diff --git a/CMakeLists.txt b/CMakeLists.txt index 9886575..7dab26f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,8 @@ set(BR_SHARE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/share/openbr") set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CPACK_PACKAGE_NAME "OpenBR") -set(CPACK_PACKAGE_VENDOR "Open Biometric Recognition") -set(CPACK_PACKAGE_DESCRIPTION "Open Source Biometric Recognition and Evaluation") +set(CPACK_PACKAGE_VENDOR "OpenBR") +set(CPACK_PACKAGE_DESCRIPTION "Open Source Biometric Recognition") set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) set(CPACK_PACKAGE_VERSION_MAJOR 0) set(CPACK_PACKAGE_VERSION_MINOR 2) diff --git a/app/br/br.cpp b/app/br/br.cpp index 9f8b1d1..dfe1fe2 100644 --- a/app/br/br.cpp +++ b/app/br/br.cpp @@ -31,8 +31,10 @@ * \endcode * * \section cli_examples Examples - * - \ref cli_compare_faces - * - \ref cli_evaluate_face_recognition + * - \ref cli_age_estimation + * - \ref cli_face_recognition + * - \ref cli_face_recognition_evaluation + * - \ref cli_gender_estimation */ static void help() diff --git a/app/examples/age_estimation.cpp b/app/examples/age_estimation.cpp new file mode 100644 index 0000000..fa55ade --- /dev/null +++ b/app/examples/age_estimation.cpp @@ -0,0 +1,58 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright 2012 The MITRE Corporation * + * * + * Licensed under the Apache License, Version 2.0 (the "License"); * + * you may not use this file except in compliance with the License. * + * You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, software * + * distributed under the License is distributed on an "AS IS" BASIS, * + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * + * See the License for the specific language governing permissions and * + * limitations under the License. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! + * \ingroup cli + * \page cli_age_estimation Age Estimation + * \ref cpp_age_estimation "C++ Equivalent" + * \code + * $ br -algorithm AgeEstimation \ + * -enroll ../data/MEDS/img/S354-01-t10_01.jpg ../data/MEDS/img/S001-01-t10_01.jpg metadata.csv + * \endcode + */ + +//! [age_estimation] +#include + +static void printTemplate(const br::Template &t) +{ + printf("%s age: %d\n", + qPrintable(t.file.fileName()), + t.file.getInt("Label")); +} + +int main(int argc, char *argv[]) +{ + br::Context::initialize(argc, argv); + + // Retrieve class for enrolling templates using the AgeEstimation algorithm + QSharedPointer transform = br::Transform::fromAlgorithm("AgeEstimation"); + + // Initialize templates + br::Template queryA("../data/MEDS/img/S354-01-t10_01.jpg"); + br::Template queryB("../data/MEDS/img/S001-01-t10_01.jpg"); + + // Enroll templates + queryA >> *transform; + queryB >> *transform; + + printTemplate(queryA); + printTemplate(queryB); + + br::Context::finalize(); + return 0; +} +//! [age_estimation] diff --git a/app/examples/compare_faces.cpp b/app/examples/face_recognition.cpp index 55eabb5..23c4bf4 100644 --- a/app/examples/compare_faces.cpp +++ b/app/examples/face_recognition.cpp @@ -16,8 +16,8 @@ /*! * \ingroup cli - * \page cli_compare_faces Compare Faces - * \ref cpp_compare_faces "Source Equivalent" + * \page cli_face_recognition Face Recognition + * \ref cpp_face_recognition "C++ Equivalent" * \code * $ br -algorithm FaceRecognition \ * -compare ../data/MEDS/img/S354-01-t10_01.jpg ../data/MEDS/img/S354-02-t10_01.jpg \ @@ -25,7 +25,7 @@ * \endcode */ -//! [compare_faces] +//! [face_recognition] #include static void printTemplate(const br::Template &t) @@ -68,4 +68,4 @@ int main(int argc, char *argv[]) br::Context::finalize(); return 0; } -//! [compare_faces] +//! [face_recognition] diff --git a/app/examples/evaluate_face_recognition.cpp b/app/examples/face_recognition_evaluation.cpp index 30ace1c..9b70abb 100644 --- a/app/examples/evaluate_face_recognition.cpp +++ b/app/examples/face_recognition_evaluation.cpp @@ -16,8 +16,8 @@ /*! * \ingroup cli - * \page cli_evaluate_face_recognition Evaluate Face Recognition - * \ref c_evaluate_face_recognition "Source Equivalent" + * \page cli_face_recognition_evaluation Face Recognition Evaluation + * \ref c_face_recognition_evaluation "C Equivalent" * \code * $ br -algorithm FaceRecognition -path ../data/MEDS/img/ \ * -enroll ../data/MEDS/sigset/MEDS_frontal_target.xml target.gal \ @@ -30,7 +30,7 @@ * \endcode */ -//! [evaluate_face_recognition] +//! [face_recognition_evaluation] #include int main(int argc, char *argv[]) @@ -67,4 +67,4 @@ int main(int argc, char *argv[]) br_finalize(); return 0; } -//! [evaluate_face_recognition] +//! [face_recognition_evaluation] diff --git a/app/examples/gender_estimation.cpp b/app/examples/gender_estimation.cpp new file mode 100644 index 0000000..fd88eea --- /dev/null +++ b/app/examples/gender_estimation.cpp @@ -0,0 +1,58 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright 2012 The MITRE Corporation * + * * + * Licensed under the Apache License, Version 2.0 (the "License"); * + * you may not use this file except in compliance with the License. * + * You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, software * + * distributed under the License is distributed on an "AS IS" BASIS, * + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * + * See the License for the specific language governing permissions and * + * limitations under the License. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! + * \ingroup cli + * \page cli_gender_estimation Gender Estimation + * \ref cpp_gender_estimation "C++ Equivalent" + * \code + * $ br -algorithm GenderEstimation \ + * -enroll ../data/MEDS/img/S354-01-t10_01.jpg ../data/MEDS/img/S001-01-t10_01.jpg metadata.csv + * \endcode + */ + +//! [gender_estimation] +#include + +static void printTemplate(const br::Template &t) +{ + printf("%s gender: %s\n", + qPrintable(t.file.fileName()), + t.file.getInt("Label") == 1 ? "Female" : "Male"); +} + +int main(int argc, char *argv[]) +{ + br::Context::initialize(argc, argv); + + // Retrieve class for enrolling templates using the GenderEstimation algorithm + QSharedPointer transform = br::Transform::fromAlgorithm("GenderEstimation"); + + // Initialize templates + br::Template queryA("../data/MEDS/img/S354-01-t10_01.jpg"); + br::Template queryB("../data/MEDS/img/S001-01-t10_01.jpg"); + + // Enroll templates + queryA >> *transform; + queryB >> *transform; + + printTemplate(queryA); + printTemplate(queryB); + + br::Context::finalize(); + return 0; +} +//! [gender_estimation] diff --git a/sdk/core/qtutils.cpp b/sdk/core/qtutils.cpp index 7b791fa..563b9d7 100644 --- a/sdk/core/qtutils.cpp +++ b/sdk/core/qtutils.cpp @@ -288,7 +288,9 @@ bool QtUtils::runDot(const QString &file) void QtUtils::showFile(const QString &file) { #ifndef BR_EMBEDDED - QDesktopServices::openUrl(QUrl::fromLocalFile(file)); + (void) file; + // A bug in Qt5 currently prevents us from doing this: + // QDesktopServices::openUrl(QUrl::fromLocalFile(file)); #else // BR_EMBEDDED (void) file; #endif // BR_EMBEDDED diff --git a/sdk/openbr.h b/sdk/openbr.h index a81d7ef..c362328 100644 --- a/sdk/openbr.h +++ b/sdk/openbr.h @@ -54,10 +54,11 @@ extern "C" { * \endcode * * \section examples Examples - * - \ref c_evaluate_face_recognition - * \subsection c_evaluate_face_recognition Evaluate Face Recognition - * \ref cli_evaluate_face_recognition "Command Line Interface Equivalent" - * \snippet app/examples/evaluate_face_recognition.cpp evaluate_face_recognition + * - \ref c_face_recognition_evaluation + * + * \subsection c_face_recognition_evaluation Face Recognition Evaluation + * \ref cli_face_recognition_evaluation "Command Line Interface Equivalent" + * \snippet app/examples/face_recognition_evaluation.cpp face_recognition_evaluation */ /*! diff --git a/sdk/openbr_export.cpp b/sdk/openbr_export.cpp index 53a5753..aa54277 100644 --- a/sdk/openbr_export.cpp +++ b/sdk/openbr_export.cpp @@ -19,7 +19,7 @@ * \section overview Overview * OpenBR \cite openbr is a toolkit for biometric recognition and evaluation. * Supported use cases include training new recognition algorithms, interfacing with commercial systems, and measuring algorithm performance. - * Free algorithms are also available for specific modalities including face recognition, face gender \& age estimation, face quality, and document classification. + * Free algorithms are also available for specific modalities including \ref cpp_face_recognition, \ref cpp_age_estimation, and \ref cpp_gender_estimation. * * There are three modules users may interact with: * - \ref cli - \copybrief cli @@ -32,7 +32,7 @@ /*! * \page installation Installation - * \brief A hacker's guide to building, editing, and running the source code. + * \brief A hacker's guide to building, editing, and running the project. * * \section installation_from_source From Source * Installation from source is the recommended method for getting OpenBR on your machine. @@ -44,7 +44,7 @@ * - \subpage linux_icc * * \section installation_from_binary From Binary - * Pre-built releases are generally not provided, though they can be built from source using the instructions above. + * Pre-compiled releases are not currently provided, but they can be built from source using the instructions above. * Generally you should follow your operating system's best practices for installing a binary package. * However, for temporary evaluation, one simple configuration approach is: * @@ -104,7 +104,7 @@ $ br -help * \endcode * -# Download Qt 5.0.1 and install: * -# Unzip "qt-everywhere-opensource-src-5.0.1.zip" - * -# Install Perl/Python/Ruby dependencies as explained in the "Windows" section of "qt-everywhere-opensource-src-5.0.1\README". + * -# Install Perl/Python/Ruby dependencies as explained in the "Windows" section of "qt-everywhere-opensource-src-5.0.1\\README". * -# From the VS2012 x64 Cross Tools Command Prompt: * \code * $ cd qt-everywhere-opensource-src-5.0.1 @@ -183,7 +183,7 @@ $ br -help * \endcode * -# Download Qt 5.0.1 and install: * -# Unzip "qt-everywhere-opensource-src-5.0.1.zip" - * -# Install Perl/Python/Ruby dependencies as explained in the "Windows" section of "qt-everywhere-opensource-src-5.0.1\README". + * -# Install Perl/Python/Ruby dependencies as explained in the "Windows" section of "qt-everywhere-opensource-src-5.0.1\\README". * -# From the MinGW-w64 Command Prompt: * \code * $ cd qt-everywhere-opensource-src-5.0.1 diff --git a/sdk/openbr_plugin.h b/sdk/openbr_plugin.h index af75d81..d9dc6e1 100644 --- a/sdk/openbr_plugin.h +++ b/sdk/openbr_plugin.h @@ -60,10 +60,21 @@ * Plugin authors are encouraged to \\cite relevant papers by adding them to share/openbr/openbr.bib. * * \section examples Examples - * - \ref cpp_compare_faces - * \subsection cpp_compare_faces Compare Faces - * \ref cli_compare_faces "Command Line Interface Equivalent" - * \snippet app/examples/compare_faces.cpp compare_faces + * - \ref cpp_face_recognition + * - \ref cpp_age_estimation + * - \ref cpp_gender_estimation + * + * \subsection cpp_face_recognition Face Recognition + * \ref cli_face_recognition "Command Line Interface Equivalent" + * \snippet app/examples/face_recognition.cpp face_recognition + * + * \subsection cpp_age_estimation Age Estimation + * \ref cli_age_estimation "Command Line Interface Equivalent" + * \snippet app/examples/age_estimation.cpp age_estimation + * + * \subsection cpp_gender_estimation Gender Estimation + * \ref cli_gender_estimation "Command Line Interface Equivalent" + * \snippet app/examples/gender_estimation.cpp gender_estimation */ namespace br diff --git a/sdk/plugins/algorithms.cpp b/sdk/plugins/algorithms.cpp index b4d53b5..37b491d 100644 --- a/sdk/plugins/algorithms.cpp +++ b/sdk/plugins/algorithms.cpp @@ -39,6 +39,8 @@ class AlgorithmsInitializer : public Initializer Globals->abbreviations.insert("MedianFace", "Open!Cascade(FrontalFace)+ASEFEyes+Affine(256,256,0.37,0.45)+Center(Median)"); Globals->abbreviations.insert("BlurredFaceDetection", "Open+LimitSize(1024)+SkinMask/(Cvt(Gray)+GradientMask)+And+Morph(Erode,16)+LargestConvexArea"); Globals->abbreviations.insert("OpenBR", "FaceRecognition"); + Globals->abbreviations.insert("GenderEstimation", "GenderClassification"); + Globals->abbreviations.insert("AgeEstimation", "AgeRegression"); // Generic Image Processing Globals->abbreviations.insert("SIFT", "Open+KeyPointDetector(SIFT)+KeyPointDescriptor(SIFT):KeyPointMatcher(BruteForce)"); @@ -59,8 +61,6 @@ class AlgorithmsInitializer : public Initializer Globals->abbreviations.insert("ColoredLBP", "Open+Affine(128,128,0.37,0.45)+Cvt(Gray)+Blur(1.1)+Gamma(0.2)+DoG(1,2)+ContrastEq(0.1,10)+LBP(1,2)+ColoredU2"); // Transforms - Globals->abbreviations.insert("SketchDetector", "(Cvt(Gray)+Cascade(FrontalFace)+ASEFEyes+RenameFirst([eyeLx,ASEF_Right_Eye_X],Affine_0_X)+RenameFirst([eyeLy,ASEF_Right_Eye_Y],Affine_0_Y)+RenameFirst([eyeRx,ASEF_Left_Eye_X],Affine_1_X)+RenameFirst([eyeRy,ASEF_Left_Eye_Y],Affine_1_Y))"); - // Globals->abbreviations.insert("SketchDetector", "(EnsureChannels(3)+PP5Enroll(true)+RenameFirst([eyeLx,PP5_Landmark0_Right_Eye_X],Affine_0_X)+RenameFirst([eyeLy,PP5_Landmark0_Right_Eye_Y],Affine_0_Y)+RenameFirst([eyeRx,PP5_Landmark1_Left_Eye_X],Affine_1_X)+RenameFirst([eyeRy,PP5_Landmark1_Left_Eye_Y],Affine_1_Y)+Cvt(Gray))"); Globals->abbreviations.insert("FaceDetection", "(Open+Cvt(Gray)+Cascade(FrontalFace))"); Globals->abbreviations.insert("DenseLBP", "(Blur(1.1)+Gamma(0.2)+DoG(1,2)+ContrastEq(0.1,10)+LBP(1,2)+RectRegions(8,8,6,6)+Hist(59))"); Globals->abbreviations.insert("DenseSIFT", "(Grid(10,10)+SIFTDescriptor(12)+ByRow)");