Commit 5386d69d4f2e905343d126d631d00d7ab6da0035
1 parent
408d060e
updated to latest janus
Showing
4 changed files
with
13 additions
and
10 deletions
openbr/janus.cpp
| ... | ... | @@ -94,21 +94,24 @@ janus_error janus_finalize_template(janus_incomplete_template incomplete_templat |
| 94 | 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 | 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 | 106 | b_templates = *(reinterpret_cast<size_t*>(b)+1); |
| 104 | - if (a_bytes != b_bytes) | |
| 107 | + if (a_template_bytes != b_template_bytes) | |
| 105 | 108 | return JANUS_UNKNOWN_ERROR; |
| 106 | 109 | |
| 107 | 110 | float dist = 0; |
| 108 | 111 | for (size_t i=0; i<a_templates; i++) |
| 109 | 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 | 115 | *similarity = a_templates * b_templates / dist; |
| 113 | 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 | 514 | BR_EXPORT br_template_list br_enroll_template(br_template tmpl); |
| 515 | 515 | /*! |
| 516 | 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 | 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 &data, const float as |
| 216 | 216 | |
| 217 | 217 | /*! |
| 218 | 218 | * \ingroup transforms |
| 219 | - * \brief . | |
| 219 | + * \brief Document me | |
| 220 | 220 | * \author Austin Blanton \cite imaus10 |
| 221 | 221 | */ |
| 222 | 222 | class BuildScalesTransform : public Transform | ... | ... |