MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / ForcePinnedPoints

Function ForcePinnedPoints

jni/stasm/misc.cpp:332–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330// This also returns the mean distance from the output shape to pinnedshape.
331
332double 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
353void ShapeMinMax( // get min and max ccords in the given shape
354 double& xmin, // out

Callers 2

stasm_search_pinnedFunction · 0.85

Calls 2

PointUsedFunction · 0.85
PointDistFunction · 0.85

Tested by

no test coverage detected