| 330 | // This also returns the mean distance from the output shape to pinnedshape. |
| 331 | |
| 332 | double ForcePinnedPoints( |
| 333 | Shape& shape, // io |
| 334 | const Shape pinnedshape) // in: points that are not pinned have coords 0,0 |
| 335 | { |
| 336 | CV_Assert(pinnedshape.rows >= shape.rows); |
| 337 | double dist = 0; |
| 338 | int npinned = 0; |
| 339 | for (int i = 0; i < shape.rows; i++) |
| 340 | { |
| 341 | if (PointUsed(pinnedshape, i)) // pinned landmark? |
| 342 | { |
| 343 | npinned++; |
| 344 | dist += PointDist(shape, pinnedshape, i); |
| 345 | shape(i, IX) = pinnedshape(i, IX); |
| 346 | shape(i, IY) = pinnedshape(i, IY); |
| 347 | } |
| 348 | } |
| 349 | CV_Assert(npinned > 0); |
| 350 | return dist / npinned; |
| 351 | } |
| 352 | |
| 353 | void ShapeMinMax( // get min and max ccords in the given shape |
| 354 | double& xmin, // out |
no test coverage detected