diff --git a/openbr/janus b/openbr/janus index f8e6e45..e5ab461 160000 --- a/openbr/janus +++ b/openbr/janus @@ -1 +1 @@ -Subproject commit f8e6e450e554612c3f173740beddf9b8daa84270 +Subproject commit e5ab46119a65d936cb765e8515d5cec0b4cb958f diff --git a/openbr/janus.cpp b/openbr/janus.cpp index fa010d2..46a6475 100644 --- a/openbr/janus.cpp +++ b/openbr/janus.cpp @@ -94,21 +94,24 @@ janus_error janus_finalize_template(janus_incomplete_template incomplete_templat return JANUS_SUCCESS; } -janus_error janus_verify(const janus_template a, const janus_template b, float *similarity) +janus_error janus_verify(const janus_template a, const size_t a_bytes, const janus_template b, const size_t b_bytes, double *similarity) { - size_t a_bytes, a_templates, b_bytes, b_templates; - a_bytes = *(reinterpret_cast(a)+0); + (void) a_bytes; + (void) b_bytes; + + size_t a_template_bytes, a_templates, b_template_bytes, b_templates; + a_template_bytes = *(reinterpret_cast(a)+0); a_templates = *(reinterpret_cast(a)+1); - b_bytes = *(reinterpret_cast(b)+0); + b_template_bytes = *(reinterpret_cast(b)+0); b_templates = *(reinterpret_cast(b)+1); - if (a_bytes != b_bytes) + if (a_template_bytes != b_template_bytes) return JANUS_UNKNOWN_ERROR; float dist = 0; for (size_t i=0; icompare(cv::Mat(1, a_bytes, CV_8UC1, a+2*sizeof(size_t)+i*a_bytes), - cv::Mat(1, b_bytes, CV_8UC1, b+2*sizeof(size_t)+i*b_bytes)); + dist += distance->compare(cv::Mat(1, a_template_bytes, CV_8UC1, a+2*sizeof(size_t)+i*a_template_bytes), + cv::Mat(1, b_template_bytes, CV_8UC1, b+2*sizeof(size_t)+i*b_template_bytes)); *similarity = a_templates * b_templates / dist; return JANUS_SUCCESS; } diff --git a/openbr/openbr.h b/openbr/openbr.h index 14d2e7a..4fc9a7c 100644 --- a/openbr/openbr.h +++ b/openbr/openbr.h @@ -514,7 +514,7 @@ BR_EXPORT const char* br_get_metadata_string(br_template, const char *key); BR_EXPORT br_template_list br_enroll_template(br_template tmpl); /*! * \brief Enroll a br::TemplateList from the C API! - * \param tmpl Pointer to a br::TemplateList. + * \param tl Pointer to a br::TemplateList. */ BR_EXPORT void br_enroll_template_list(br_template_list tl); /*! diff --git a/openbr/plugins/slidingwindow.cpp b/openbr/plugins/slidingwindow.cpp index 5cabca2..8e76c51 100644 --- a/openbr/plugins/slidingwindow.cpp +++ b/openbr/plugins/slidingwindow.cpp @@ -216,7 +216,7 @@ static TemplateList cropTrainingSamples(const TemplateList &data, const float as /*! * \ingroup transforms - * \brief . + * \brief Document me * \author Austin Blanton \cite imaus10 */ class BuildScalesTransform : public Transform