Commit bbf270f532076807e22e1a52c0868ab6567ffc51
1 parent
1acaf2f3
Added doxygen comments
Showing
1 changed file
with
16 additions
and
2 deletions
openbr/plugins/landmarks.cpp
| @@ -437,6 +437,11 @@ class AnonymizeLandmarkTransform : public UntrainableMetadataTransform | @@ -437,6 +437,11 @@ class AnonymizeLandmarkTransform : public UntrainableMetadataTransform | ||
| 437 | 437 | ||
| 438 | BR_REGISTER(Transform, AnonymizeLandmarkTransform) | 438 | BR_REGISTER(Transform, AnonymizeLandmarkTransform) |
| 439 | 439 | ||
| 440 | +/*! | ||
| 441 | + * \ingroup transforms | ||
| 442 | + * \brief Converts either the file::points() list or a QList<QPointF> metadata item to be the template's matrix | ||
| 443 | + * \author Scott Klum \cite sklum | ||
| 444 | + */ | ||
| 440 | class PointsToMatrixTransform : public UntrainableTransform | 445 | class PointsToMatrixTransform : public UntrainableTransform |
| 441 | { | 446 | { |
| 442 | Q_OBJECT | 447 | Q_OBJECT |
| @@ -459,6 +464,11 @@ class PointsToMatrixTransform : public UntrainableTransform | @@ -459,6 +464,11 @@ class PointsToMatrixTransform : public UntrainableTransform | ||
| 459 | 464 | ||
| 460 | BR_REGISTER(Transform, PointsToMatrixTransform) | 465 | BR_REGISTER(Transform, PointsToMatrixTransform) |
| 461 | 466 | ||
| 467 | +/*! | ||
| 468 | + * \ingroup transforms | ||
| 469 | + * \brief Normalize points to be relative to a single point | ||
| 470 | + * \author Scott Klum \cite sklum | ||
| 471 | + */ | ||
| 462 | class NormalizePointsTransform : public UntrainableTransform | 472 | class NormalizePointsTransform : public UntrainableTransform |
| 463 | { | 473 | { |
| 464 | Q_OBJECT | 474 | Q_OBJECT |
| @@ -474,8 +484,6 @@ class NormalizePointsTransform : public UntrainableTransform | @@ -474,8 +484,6 @@ class NormalizePointsTransform : public UntrainableTransform | ||
| 474 | QPointF normPoint = points.at(index); | 484 | QPointF normPoint = points.at(index); |
| 475 | 485 | ||
| 476 | QList<QPointF> normalizedPoints; | 486 | QList<QPointF> normalizedPoints; |
| 477 | - // We have nose and two eyes and I want a feature vector like: | ||
| 478 | - // (nose.x-right_eye.x,nose.y-right_eye.y),(nose.x-left_eye.x,nose.y-left_eye.y),(0,0) because we're centering on the nose | ||
| 479 | 487 | ||
| 480 | for (int i=0; i<points.size(); i++) | 488 | for (int i=0; i<points.size(); i++) |
| 481 | if (i!=index) | 489 | if (i!=index) |
| @@ -487,6 +495,11 @@ class NormalizePointsTransform : public UntrainableTransform | @@ -487,6 +495,11 @@ class NormalizePointsTransform : public UntrainableTransform | ||
| 487 | 495 | ||
| 488 | BR_REGISTER(Transform, NormalizePointsTransform) | 496 | BR_REGISTER(Transform, NormalizePointsTransform) |
| 489 | 497 | ||
| 498 | +/*! | ||
| 499 | + * \ingroup transforms | ||
| 500 | + * \brief Normalize points to be relative to a single point | ||
| 501 | + * \author Scott Klum \cite sklum | ||
| 502 | + */ | ||
| 490 | class PointDisplacementTransform : public UntrainableTransform | 503 | class PointDisplacementTransform : public UntrainableTransform |
| 491 | { | 504 | { |
| 492 | Q_OBJECT | 505 | Q_OBJECT |
| @@ -500,6 +513,7 @@ class PointDisplacementTransform : public UntrainableTransform | @@ -500,6 +513,7 @@ class PointDisplacementTransform : public UntrainableTransform | ||
| 500 | 513 | ||
| 501 | for (int i=0; i<points.size(); i++) | 514 | for (int i=0; i<points.size(); i++) |
| 502 | for (int j=0; j<points.size(); j++) | 515 | for (int j=0; j<points.size(); j++) |
| 516 | + // There is redundant information here | ||
| 503 | if (j!=i) { | 517 | if (j!=i) { |
| 504 | QPointF normalizedPoint = points[i]-points[j]; | 518 | QPointF normalizedPoint = points[i]-points[j]; |
| 505 | normalizedPoint.setX(pow(normalizedPoint.x(),2)); | 519 | normalizedPoint.setX(pow(normalizedPoint.x(),2)); |