Commit b96e72db6376a17b19e2c081ea51c6edcac5a1f5

Authored by Scott Klum
1 parent f1f3728b

Cleaned up Sum and Attribute distance, and added proper label comments

Showing 1 changed file with 7 additions and 3 deletions
openbr/plugins/distance.cpp
@@ -389,6 +389,9 @@ class OnlineDistance : public Distance @@ -389,6 +389,9 @@ class OnlineDistance : public Distance
389 BR_REGISTER(Distance, OnlineDistance) 389 BR_REGISTER(Distance, OnlineDistance)
390 390
391 /*! 391 /*!
  392 + * \ingroup distances
  393 + * \brief Attenuation function based distance from attributes
  394 + * \author Scott Klum \cite sklum
392 */ 395 */
393 class AttributeDistance : public Distance 396 class AttributeDistance : public Distance
394 { 397 {
@@ -398,10 +401,10 @@ class AttributeDistance : public Distance @@ -398,10 +401,10 @@ class AttributeDistance : public Distance
398 401
399 float compare(const Template &target, const Template &query) const 402 float compare(const Template &target, const Template &query) const
400 { 403 {
401 - // Make gaussian attenuation distribution around query attribute value  
402 float queryValue = query.file.get<float>(attribute); 404 float queryValue = query.file.get<float>(attribute);
403 float targetValue = target.file.get<float>(attribute); 405 float targetValue = target.file.get<float>(attribute);
404 406
  407 + // TODO: Set this magic number to something meaningful
405 float stddev = 1; 408 float stddev = 1;
406 409
407 if (queryValue == targetValue) return 1; 410 if (queryValue == targetValue) return 1;
@@ -412,14 +415,15 @@ class AttributeDistance : public Distance @@ -412,14 +415,15 @@ class AttributeDistance : public Distance
412 BR_REGISTER(Distance, AttributeDistance) 415 BR_REGISTER(Distance, AttributeDistance)
413 416
414 /*! 417 /*!
  418 + * \ingroup distances
  419 + * \brief Sum match scores across multiple distances
  420 + * \author Scott Klum \cite sklum
415 */ 421 */
416 class SumDistance : public Distance 422 class SumDistance : public Distance
417 { 423 {
418 Q_OBJECT 424 Q_OBJECT
419 Q_PROPERTY(QList<br::Distance*> distances READ get_distances WRITE set_distances RESET reset_distances) 425 Q_PROPERTY(QList<br::Distance*> distances READ get_distances WRITE set_distances RESET reset_distances)
420 - Q_PROPERTY(QString attribute READ get_attribute WRITE set_attribute RESET reset_attribute STORED false)  
421 BR_PROPERTY(QList<br::Distance*>, distances, QList<br::Distance*>()) 426 BR_PROPERTY(QList<br::Distance*>, distances, QList<br::Distance*>())
422 - BR_PROPERTY(QString, attribute, QString())  
423 427
424 void train(const TemplateList &data) 428 void train(const TemplateList &data)
425 { 429 {