From a30beafbf64e56e46f832a52c262db04d1be4fbc Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Fri, 18 Jul 2014 14:48:51 -0400 Subject: [PATCH] updated to latest janus --- openbr/janus | 2 +- openbr/janus.cpp | 4 ++-- openbr/janus_io.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openbr/janus b/openbr/janus index 9312f45..174446c 160000 --- a/openbr/janus +++ b/openbr/janus @@ -1 +1 @@ -Subproject commit 9312f459d3628cf05fd9869cd8f731bec22624bd +Subproject commit 174446c7b108093166c07021c7db052a896c0dbd diff --git a/openbr/janus.cpp b/openbr/janus.cpp index 3f69523..22ed6c7 100644 --- a/openbr/janus.cpp +++ b/openbr/janus.cpp @@ -60,14 +60,14 @@ janus_error janus_augment(const janus_image image, const janus_attribute_list at !t.file.contains("RIGHT_EYE_Y") || !t.file.contains("LEFT_EYE_X") || !t.file.contains("LEFT_EYE_Y")) - return JANUS_SUCCESS; + return JANUS_MISSING_ATTRIBUTES; t.file.set("Affine_0", QPointF(t.file.get("RIGHT_EYE_X"), t.file.get("RIGHT_EYE_Y"))); t.file.set("Affine_1", QPointF(t.file.get("LEFT_EYE_X"), t.file.get("LEFT_EYE_Y"))); Template u; transform->project(t, u); template_->append(u); - return JANUS_SUCCESS; + return u.isEmpty() ? JANUS_FAILURE_TO_ENROLL : JANUS_SUCCESS; } janus_error janus_finalize_template(janus_template template_, janus_flat_template flat_template, size_t *bytes) diff --git a/openbr/janus_io.cpp b/openbr/janus_io.cpp index a371bf8..5bb09ad 100644 --- a/openbr/janus_io.cpp +++ b/openbr/janus_io.cpp @@ -11,11 +11,11 @@ static void _janus_add_sample(vector &samples, double sample) samples.push_back(sample); } -static void _janus_create_template(const char *data_path, TemplateData templateData, janus_gallery gallery) +static void _janus_create_template(const char *data_path, TemplateData templateData, janus_gallery gallery, bool verbose) { janus_template template_; janus_template_id templateID; - JANUS_ASSERT(TemplateIterator::create(data_path, templateData, &template_, &templateID)) + JANUS_ASSERT(TemplateIterator::create(data_path, templateData, &template_, &templateID, verbose)) static QMutex enrollLock; QMutexLocker enrollLocker(&enrollLock); @@ -23,13 +23,13 @@ static void _janus_create_template(const char *data_path, TemplateData templateD JANUS_ASSERT(janus_enroll(template_, templateID, gallery)) } -janus_error janus_create_gallery(const char *data_path, janus_metadata metadata, janus_gallery gallery) +janus_error janus_create_gallery(const char *data_path, janus_metadata metadata, janus_gallery gallery, bool verbose) { TemplateIterator ti(metadata, true); TemplateData templateData = ti.next(); QFutureSynchronizer futures; while (!templateData.templateIDs.empty()) { - futures.addFuture(QtConcurrent::run(_janus_create_template, data_path, templateData, gallery)); + futures.addFuture(QtConcurrent::run(_janus_create_template, data_path, templateData, gallery, verbose)); templateData = ti.next(); } futures.waitForFinished(); -- libgit2 0.21.4