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 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 396 class AttributeDistance : public Distance
394 397 {
... ... @@ -398,10 +401,10 @@ class AttributeDistance : public Distance
398 401  
399 402 float compare(const Template &target, const Template &query) const
400 403 {
401   - // Make gaussian attenuation distribution around query attribute value
402 404 float queryValue = query.file.get<float>(attribute);
403 405 float targetValue = target.file.get<float>(attribute);
404 406  
  407 + // TODO: Set this magic number to something meaningful
405 408 float stddev = 1;
406 409  
407 410 if (queryValue == targetValue) return 1;
... ... @@ -412,14 +415,15 @@ class AttributeDistance : public Distance
412 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 422 class SumDistance : public Distance
417 423 {
418 424 Q_OBJECT
419 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 426 BR_PROPERTY(QList<br::Distance*>, distances, QList<br::Distance*>())
422   - BR_PROPERTY(QString, attribute, QString())
423 427  
424 428 void train(const TemplateList &data)
425 429 {
... ...