| 148 | } |
| 149 | |
| 150 | static Shape Shape5( // return a 5 point shape |
| 151 | const Shape& pinned, // in: pinned landmarks, canonical 5 points are best |
| 152 | const Shape& meanshape) // in: used only if pinned landmarks are not canonical |
| 153 | { |
| 154 | const Shape pinned17(Shape17(pinned)); |
| 155 | const Shape meanshape17(Shape17(meanshape)); |
| 156 | Shape newpinned17(pinned17); |
| 157 | if (!HaveCanonical5Points(pinned17)) |
| 158 | { |
| 159 | // Not canonical 5 point pinned landmarks. Impute the missing points. |
| 160 | // This is not an optimal situation but will at least allow estimation |
| 161 | // of the pose from an arb set of pinned landmarks. |
| 162 | // TODO Only the Shape17 points are considered. |
| 163 | |
| 164 | newpinned17 = PinMeanShape(pinned17, meanshape17); |
| 165 | } |
| 166 | Shape shape5(5, 2); // 5 point shape |
| 167 | |
| 168 | CopyPoint(shape5, newpinned17, 0, L17_LEyeOuter); |
| 169 | CopyPoint(shape5, newpinned17, 1, L17_REyeOuter); |
| 170 | CopyPoint(shape5, newpinned17, 2, L17_CNoseTip); |
| 171 | CopyPoint(shape5, newpinned17, 3, L17_LMouthCorner); |
| 172 | CopyPoint(shape5, newpinned17, 4, L17_RMouthCorner); |
| 173 | |
| 174 | return shape5; |
| 175 | } |
| 176 | |
| 177 | static void InitDetParEyeMouthFromShape( // fill in eye and mouth fields of detpar |
| 178 | DetectorParameter& detpar, |
no test coverage detected