| 244 | } |
| 245 | |
| 246 | Shape Shape17OrEmpty( // like Shape17 but return zero point shape if can't convert |
| 247 | const Shape& shape) // in |
| 248 | { |
| 249 | const int* const tab = Shape17Tab(shape); |
| 250 | if (!tab) |
| 251 | { |
| 252 | static int printed; |
| 253 | PrintOnce(printed, |
| 254 | "\nDo not know how to convert a %d point shape to a 17 point face...\n", |
| 255 | shape.rows); |
| 256 | return Shape(0, 2); // note return |
| 257 | } |
| 258 | Shape shape17(17, 2); |
| 259 | for (int i = 0; i < 17; i++) |
| 260 | { |
| 261 | int iold = tab[i]; |
| 262 | CV_Assert(iold >= 0 && iold < NSIZE(shape)); |
| 263 | shape17(i, IX) = shape(iold, IX); |
| 264 | shape17(i, IY) = shape(iold, IY); |
| 265 | } |
| 266 | if (shape.rows == 21) // 21 point AFLW set? |
| 267 | TweakAflw(shape17); |
| 268 | else if (shape.rows == 194) // 194 point Helen set? |
| 269 | TweakHelen(shape17); |
| 270 | |
| 271 | return shape17; |
| 272 | } |
| 273 | |
| 274 | Shape Shape17( // convert an arb face shape to a 17 point shape, err if can't |
| 275 | const Shape& shape) // in |
no test coverage detected