Commit f3692eaa3cb9ba73b238189b74d28b3698e1a39c
1 parent
bb82e2db
Using stasmSrc
Showing
1 changed file
with
15 additions
and
15 deletions
openbr/plugins/stasm4.cpp
| ... | ... | @@ -93,27 +93,27 @@ class StasmTransform : public UntrainableTransform |
| 93 | 93 | int nLandmarks = stasm_NLANDMARKS; |
| 94 | 94 | float landmarks[2 * stasm_NLANDMARKS]; |
| 95 | 95 | |
| 96 | - bool searchPinned = false; | |
| 96 | + bool searchPinned = false; | |
| 97 | 97 | |
| 98 | - QPointF rightEye, leftEye; | |
| 99 | - /* Two use cases are accounted for: | |
| 100 | - * 1. Pin eyes without normalization: in this case the string list should contain the KEYS for right then left eyes, respectively. | |
| 101 | - * 2. Pin eyes with normalization: in this case the string list should contain the COORDINATES of the right then left eyes, respectively. | |
| 102 | - * Currently, we only support normalization with a transformation such that the src file contains Affine_0 and Affine_1. Checking for | |
| 103 | - * these keys prevents us from pinning eyes on a face that wasn't actually transformed (see AffineTransform). | |
| 104 | - * If both cases fail, we default to stasm_search_single. */ | |
| 98 | + QPointF rightEye, leftEye; | |
| 99 | + /* Two use cases are accounted for: | |
| 100 | + * 1. Pin eyes without normalization: in this case the string list should contain the KEYS for right then left eyes, respectively. | |
| 101 | + * 2. Pin eyes with normalization: in this case the string list should contain the COORDINATES of the right then left eyes, respectively. | |
| 102 | + * Currently, we only support normalization with a transformation such that the src file contains Affine_0 and Affine_1. Checking for | |
| 103 | + * these keys prevents us from pinning eyes on a face that wasn't actually transformed (see AffineTransform). | |
| 104 | + * If both cases fail, we default to stasm_search_single. */ | |
| 105 | 105 | |
| 106 | 106 | if (!pinPoints.isEmpty() && src.file.contains("Affine_0") && src.file.contains("Affine_1")) { |
| 107 | 107 | rightEye = QPointF(pinPoints.at(0), pinPoints.at(1)); |
| 108 | 108 | leftEye = QPointF(pinPoints.at(2), pinPoints.at(3)); |
| 109 | - searchPinned = true; | |
| 110 | - } else if (!pinLabels.isEmpty()) { | |
| 109 | + searchPinned = true; | |
| 110 | + } else if (!pinLabels.isEmpty()) { | |
| 111 | 111 | rightEye = src.file.get<QPointF>(pinLabels.at(0), QPointF()); |
| 112 | 112 | leftEye = src.file.get<QPointF>(pinLabels.at(1), QPointF()); |
| 113 | - searchPinned = true; | |
| 114 | - } | |
| 113 | + searchPinned = true; | |
| 114 | + } | |
| 115 | 115 | |
| 116 | - if (searchPinned) { | |
| 116 | + if (searchPinned) { | |
| 117 | 117 | float pins[2 * stasm_NLANDMARKS]; |
| 118 | 118 | |
| 119 | 119 | for (int i = 0; i < nLandmarks; i++) { |
| ... | ... | @@ -122,13 +122,13 @@ class StasmTransform : public UntrainableTransform |
| 122 | 122 | else { pins[2*i] = 0; pins[2*i+1] = 0; } |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - stasm_search_pinned(landmarks, pins, reinterpret_cast<const char*>(src.m().data), src.m().cols, src.m().rows, NULL); | |
| 125 | + stasm_search_pinned(landmarks, pins, reinterpret_cast<const char*>(stasmSrc.data), stasmSrc.cols, stasmSrc.rows, NULL); | |
| 126 | 126 | |
| 127 | 127 | // The ASM in Stasm is guaranteed to converge in this case |
| 128 | 128 | foundFace = 1; |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - if (!foundFace) stasm_search_single(&foundFace, landmarks, reinterpret_cast<const char*>(src.m().data), src.m().cols, src.m().rows, *stasmCascade, NULL, NULL); | |
| 131 | + if (!foundFace) stasm_search_single(&foundFace, landmarks, reinterpret_cast<const char*>(stasmSrc.data), stasmSrc.cols, stasmSrc.rows, *stasmCascade, NULL, NULL); | |
| 132 | 132 | |
| 133 | 133 | if (stasm3Format) { |
| 134 | 134 | nLandmarks = 76; | ... | ... |