Commit ab5106bb37e1c3ec53e81b658d8c833ad6fe5863
1 parent
21187d89
improved examples
Showing
2 changed files
with
18 additions
and
6 deletions
app/examples/compare_faces.cpp
| @@ -20,14 +20,22 @@ | @@ -20,14 +20,22 @@ | ||
| 20 | * \ref cpp_compare_faces "Source Equivalent" | 20 | * \ref cpp_compare_faces "Source Equivalent" |
| 21 | * \code | 21 | * \code |
| 22 | * $ br -algorithm FaceRecognition \ | 22 | * $ br -algorithm FaceRecognition \ |
| 23 | - * -compare ../share/openbr/images/S354-01-t10_01.jpg ../share/openbr/images/S354-02-t10_01.jpg \ | ||
| 24 | - * -compare ../share/openbr/images/S024-01-t10_01.jpg ../share/openbr/images/S354-02-t10_01.jpg | 23 | + * -compare ../data/MEDS/img/S354-01-t10_01.jpg ../data/MEDS/img/S354-02-t10_01.jpg \ |
| 24 | + * -compare ../data/MEDS/img/S354-01-t10_01.jpg ../data/MEDS/img/S386-04-t10_01.jpg | ||
| 25 | * \endcode | 25 | * \endcode |
| 26 | */ | 26 | */ |
| 27 | 27 | ||
| 28 | //! [compare_faces] | 28 | //! [compare_faces] |
| 29 | #include <openbr_plugin.h> | 29 | #include <openbr_plugin.h> |
| 30 | 30 | ||
| 31 | +static void printTemplate(const br::Template &t) | ||
| 32 | +{ | ||
| 33 | + printf("%s eyes: (%d, %d) (%d, %d)\n", | ||
| 34 | + qPrintable(t.file.fileName()), | ||
| 35 | + t.file.getInt("Affine_0_X"), t.file.getInt("Affine_0_Y"), | ||
| 36 | + t.file.getInt("Affine_1_X"), t.file.getInt("Affine_1_Y")); | ||
| 37 | +} | ||
| 38 | + | ||
| 31 | int main(int argc, char *argv[]) | 39 | int main(int argc, char *argv[]) |
| 32 | { | 40 | { |
| 33 | br::Context::initialize(argc, argv); | 41 | br::Context::initialize(argc, argv); |
| @@ -37,15 +45,19 @@ int main(int argc, char *argv[]) | @@ -37,15 +45,19 @@ int main(int argc, char *argv[]) | ||
| 37 | QSharedPointer<br::Distance> distance = br::Distance::fromAlgorithm("FaceRecognition"); | 45 | QSharedPointer<br::Distance> distance = br::Distance::fromAlgorithm("FaceRecognition"); |
| 38 | 46 | ||
| 39 | // Initialize templates | 47 | // Initialize templates |
| 40 | - br::Template queryA("../data/MEDS/img/S354-02-t10_01.jpg"); | 48 | + br::Template queryA("../data/MEDS/img/S354-01-t10_01.jpg"); |
| 41 | br::Template queryB("../data/MEDS/img/S386-04-t10_01.jpg"); | 49 | br::Template queryB("../data/MEDS/img/S386-04-t10_01.jpg"); |
| 42 | - br::Template target("../data/MEDS/img/S354-01-t10_01.jpg"); | 50 | + br::Template target("../data/MEDS/img/S354-02-t10_01.jpg"); |
| 43 | 51 | ||
| 44 | // Enroll templates | 52 | // Enroll templates |
| 45 | queryA >> *transform; | 53 | queryA >> *transform; |
| 46 | queryB >> *transform; | 54 | queryB >> *transform; |
| 47 | target >> *transform; | 55 | target >> *transform; |
| 48 | 56 | ||
| 57 | + printTemplate(queryA); | ||
| 58 | + printTemplate(queryB); | ||
| 59 | + printTemplate(target); | ||
| 60 | + | ||
| 49 | // Compare templates | 61 | // Compare templates |
| 50 | float comparisonA = distance->compare(target, queryA); | 62 | float comparisonA = distance->compare(target, queryA); |
| 51 | float comparisonB = distance->compare(target, queryB); | 63 | float comparisonB = distance->compare(target, queryB); |
app/examples/evaluate_face_recognition.cpp
| @@ -19,13 +19,13 @@ | @@ -19,13 +19,13 @@ | ||
| 19 | * \page cli_evaluate_face_recognition Evaluate Face Recognition | 19 | * \page cli_evaluate_face_recognition Evaluate Face Recognition |
| 20 | * \ref c_evaluate_face_recognition "Source Equivalent" | 20 | * \ref c_evaluate_face_recognition "Source Equivalent" |
| 21 | * \code | 21 | * \code |
| 22 | - * $ br -algorithm FaceRecognition -path ../share/openbr/images/ \ | 22 | + * $ br -algorithm FaceRecognition -path ../data/MEDS/img/ \ |
| 23 | * -enroll ../data/MEDS/sigset/MEDS_frontal_target.xml target.gal \ | 23 | * -enroll ../data/MEDS/sigset/MEDS_frontal_target.xml target.gal \ |
| 24 | * -enroll ../data/MEDS/sigset/MEDS_frontal_query.xml query.gal \ | 24 | * -enroll ../data/MEDS/sigset/MEDS_frontal_query.xml query.gal \ |
| 25 | * -compare target.gal query.gal scores.mtx \ | 25 | * -compare target.gal query.gal scores.mtx \ |
| 26 | * -makeMask ../data/MEDS/sigset/MEDS_frontal_target.xml ../data/MEDS/sigset/MEDS_frontal_query.xml MEDS.mask \ | 26 | * -makeMask ../data/MEDS/sigset/MEDS_frontal_target.xml ../data/MEDS/sigset/MEDS_frontal_query.xml MEDS.mask \ |
| 27 | * -eval scores.mtx MEDS.mask Algorithm_Dataset/FaceRecognition_MEDS.csv \ | 27 | * -eval scores.mtx MEDS.mask Algorithm_Dataset/FaceRecognition_MEDS.csv \ |
| 28 | - * -eval ../data/MEDS/simmat/COTS.mtx MEDS.mask Algorithm_Dataset/COTS_MEDS.csv \ | 28 | + * -eval ../data/MEDS/simmat/COTS_MEDS.mtx MEDS.mask Algorithm_Dataset/COTS_MEDS.csv \ |
| 29 | * -plot Algorithm_Dataset/FaceRecognition_MEDS.csv Algorithm_Dataset/COTS_MEDS.csv MEDS | 29 | * -plot Algorithm_Dataset/FaceRecognition_MEDS.csv Algorithm_Dataset/COTS_MEDS.csv MEDS |
| 30 | * \endcode | 30 | * \endcode |
| 31 | */ | 31 | */ |