Commit 09be749f8dad21c3d66f9d7d3cceadeb2b450e4e
1 parent
92ef495f
Implemented variantlist instead of stringlist
Showing
1 changed file
with
11 additions
and
7 deletions
openbr/plugins/stasm4.cpp
| @@ -64,8 +64,8 @@ class StasmTransform : public UntrainableTransform | @@ -64,8 +64,8 @@ class StasmTransform : public UntrainableTransform | ||
| 64 | BR_PROPERTY(bool, stasm3Format, false) | 64 | BR_PROPERTY(bool, stasm3Format, false) |
| 65 | Q_PROPERTY(bool clearLandmarks READ get_clearLandmarks WRITE set_clearLandmarks RESET reset_clearLandmarks STORED false) | 65 | Q_PROPERTY(bool clearLandmarks READ get_clearLandmarks WRITE set_clearLandmarks RESET reset_clearLandmarks STORED false) |
| 66 | BR_PROPERTY(bool, clearLandmarks, false) | 66 | BR_PROPERTY(bool, clearLandmarks, false) |
| 67 | - Q_PROPERTY(QStringList pinEyes READ get_pinEyes WRITE set_pinEyes RESET reset_pinEyes STORED false) | ||
| 68 | - BR_PROPERTY(QStringList, pinEyes, QStringList()) | 67 | + Q_PROPERTY(QVariantList pinEyes READ get_pinEyes WRITE set_pinEyes RESET reset_pinEyes STORED false) |
| 68 | + BR_PROPERTY(QVariantList, pinEyes, QVariantList()) | ||
| 69 | 69 | ||
| 70 | Resource<StasmCascadeClassifier> stasmCascadeResource; | 70 | Resource<StasmCascadeClassifier> stasmCascadeResource; |
| 71 | 71 | ||
| @@ -102,15 +102,19 @@ class StasmTransform : public UntrainableTransform | @@ -102,15 +102,19 @@ class StasmTransform : public UntrainableTransform | ||
| 102 | QPointF leftEye; | 102 | QPointF leftEye; |
| 103 | 103 | ||
| 104 | if (src.file.contains("Affine_0") && src.file.contains("Affine_1")) { | 104 | if (src.file.contains("Affine_0") && src.file.contains("Affine_1")) { |
| 105 | - rightEye = QtUtils::toPoint(pinEyes.at(0),&ok); | ||
| 106 | - leftEye = QtUtils::toPoint(pinEyes.at(1),&ok); | 105 | + rightEye = pinEyes.at(0).toPointF(); |
| 106 | + leftEye = pinEyes.at(1).toPointF(); | ||
| 107 | + if (!rightEye.isNull() && !leftEye.isNull()) | ||
| 108 | + ok = true; | ||
| 107 | } | 109 | } |
| 108 | 110 | ||
| 109 | if (!ok) { | 111 | if (!ok) { |
| 110 | - if (src.file.contains(pinEyes.at(0)) && src.file.contains(pinEyes.at(1))) | 112 | + QString r = pinEyes.at(0).toString(); |
| 113 | + QString l = pinEyes.at(1).toString(); | ||
| 114 | + if (!r.isNull() && !l.isNull() && src.file.contains(r) && src.file.contains(l)) | ||
| 111 | { | 115 | { |
| 112 | - rightEye = src.file.get<QPointF>(pinEyes.at(0), QPointF()); | ||
| 113 | - leftEye = src.file.get<QPointF>(pinEyes.at(1), QPointF()); | 116 | + rightEye = src.file.get<QPointF>(pinEyes.at(0).toString(), QPointF()); |
| 117 | + leftEye = src.file.get<QPointF>(pinEyes.at(1).toString(), QPointF()); | ||
| 114 | ok = true; | 118 | ok = true; |
| 115 | } | 119 | } |
| 116 | } | 120 | } |