Commit ac20fcb83ec1f780565ce7d35400b6674f68310f
1 parent
99e24f93
Bug fix in FaceFromEyes parameters
Showing
1 changed file
with
3 additions
and
3 deletions
openbr/plugins/regions.cpp
| ... | ... | @@ -372,7 +372,7 @@ class FaceFromEyesTransform : public UntrainableTransform |
| 372 | 372 | BR_PROPERTY(double, widthPadding, 0.7) |
| 373 | 373 | BR_PROPERTY(double, verticalLocation, 0.25) |
| 374 | 374 | BR_PROPERTY(int, leftEyeIdx, 0) |
| 375 | - BR_PROPERTY(int, rightEyeIdx, 0) | |
| 375 | + BR_PROPERTY(int, rightEyeIdx, 1) | |
| 376 | 376 | |
| 377 | 377 | void project(const Template &src, Template &dst) const |
| 378 | 378 | { |
| ... | ... | @@ -384,8 +384,8 @@ class FaceFromEyesTransform : public UntrainableTransform |
| 384 | 384 | return; |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | - QPointF eyeL = src.file.points()[0]; | |
| 388 | - QPointF eyeR = src.file.points()[1]; | |
| 387 | + QPointF eyeL = src.file.points()[leftEyeIdx]; | |
| 388 | + QPointF eyeR = src.file.points()[rightEyeIdx]; | |
| 389 | 389 | QPointF eyeCenter((eyeL.x() + eyeR.x()) / 2, (eyeL.y() + eyeR.y()) / 2); |
| 390 | 390 | float ipd = sqrt(pow(eyeL.x() - eyeR.x(), 2) + pow(eyeL.y() - eyeR.y(), 2)); |
| 391 | 391 | float width = ipd + 2 * widthPadding * ipd; | ... | ... |