Commit 5386d69d4f2e905343d126d631d00d7ab6da0035

Authored by Josh Klontz
1 parent 408d060e

updated to latest janus

1 -Subproject commit f8e6e450e554612c3f173740beddf9b8daa84270 1 +Subproject commit e5ab46119a65d936cb765e8515d5cec0b4cb958f
openbr/janus.cpp
@@ -94,21 +94,24 @@ janus_error janus_finalize_template(janus_incomplete_template incomplete_templat @@ -94,21 +94,24 @@ janus_error janus_finalize_template(janus_incomplete_template incomplete_templat
94 return JANUS_SUCCESS; 94 return JANUS_SUCCESS;
95 } 95 }
96 96
97 -janus_error janus_verify(const janus_template a, const janus_template b, float *similarity) 97 +janus_error janus_verify(const janus_template a, const size_t a_bytes, const janus_template b, const size_t b_bytes, double *similarity)
98 { 98 {
99 - size_t a_bytes, a_templates, b_bytes, b_templates;  
100 - a_bytes = *(reinterpret_cast<size_t*>(a)+0); 99 + (void) a_bytes;
  100 + (void) b_bytes;
  101 +
  102 + size_t a_template_bytes, a_templates, b_template_bytes, b_templates;
  103 + a_template_bytes = *(reinterpret_cast<size_t*>(a)+0);
101 a_templates = *(reinterpret_cast<size_t*>(a)+1); 104 a_templates = *(reinterpret_cast<size_t*>(a)+1);
102 - b_bytes = *(reinterpret_cast<size_t*>(b)+0); 105 + b_template_bytes = *(reinterpret_cast<size_t*>(b)+0);
103 b_templates = *(reinterpret_cast<size_t*>(b)+1); 106 b_templates = *(reinterpret_cast<size_t*>(b)+1);
104 - if (a_bytes != b_bytes) 107 + if (a_template_bytes != b_template_bytes)
105 return JANUS_UNKNOWN_ERROR; 108 return JANUS_UNKNOWN_ERROR;
106 109
107 float dist = 0; 110 float dist = 0;
108 for (size_t i=0; i<a_templates; i++) 111 for (size_t i=0; i<a_templates; i++)
109 for (size_t j=0; j<b_templates; j++) 112 for (size_t j=0; j<b_templates; j++)
110 - dist += distance->compare(cv::Mat(1, a_bytes, CV_8UC1, a+2*sizeof(size_t)+i*a_bytes),  
111 - cv::Mat(1, b_bytes, CV_8UC1, b+2*sizeof(size_t)+i*b_bytes)); 113 + dist += distance->compare(cv::Mat(1, a_template_bytes, CV_8UC1, a+2*sizeof(size_t)+i*a_template_bytes),
  114 + cv::Mat(1, b_template_bytes, CV_8UC1, b+2*sizeof(size_t)+i*b_template_bytes));
112 *similarity = a_templates * b_templates / dist; 115 *similarity = a_templates * b_templates / dist;
113 return JANUS_SUCCESS; 116 return JANUS_SUCCESS;
114 } 117 }
openbr/openbr.h
@@ -514,7 +514,7 @@ BR_EXPORT const char* br_get_metadata_string(br_template, const char *key); @@ -514,7 +514,7 @@ BR_EXPORT const char* br_get_metadata_string(br_template, const char *key);
514 BR_EXPORT br_template_list br_enroll_template(br_template tmpl); 514 BR_EXPORT br_template_list br_enroll_template(br_template tmpl);
515 /*! 515 /*!
516 * \brief Enroll a br::TemplateList from the C API! 516 * \brief Enroll a br::TemplateList from the C API!
517 - * \param tmpl Pointer to a br::TemplateList. 517 + * \param tl Pointer to a br::TemplateList.
518 */ 518 */
519 BR_EXPORT void br_enroll_template_list(br_template_list tl); 519 BR_EXPORT void br_enroll_template_list(br_template_list tl);
520 /*! 520 /*!
openbr/plugins/slidingwindow.cpp
@@ -216,7 +216,7 @@ static TemplateList cropTrainingSamples(const TemplateList &amp;data, const float as @@ -216,7 +216,7 @@ static TemplateList cropTrainingSamples(const TemplateList &amp;data, const float as
216 216
217 /*! 217 /*!
218 * \ingroup transforms 218 * \ingroup transforms
219 - * \brief . 219 + * \brief Document me
220 * \author Austin Blanton \cite imaus10 220 * \author Austin Blanton \cite imaus10
221 */ 221 */
222 class BuildScalesTransform : public Transform 222 class BuildScalesTransform : public Transform