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

Function AlignMeanShapeToRightEyeMouth

jni/stasm/startshape.cpp:253–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253static Shape AlignMeanShapeToRightEyeMouth(
254 const DetectorParameter& detpar, // in
255 const Shape& meanshape) // in
256{
257 if (trace_g)
258 lprintf("AlignToRightEyeMouth ");
259
260 CV_Assert(NSIZE(meanshape) > 0 && PointUsed(meanshape, 0));
261 CV_Assert(!Valid(detpar.lex)); // left eye invalid? (else why are we here?)
262 CV_Assert(Valid(detpar.rex)); // right eye valid?
263 CV_Assert(Valid(detpar.mouthx)); // mouth valid?
264
265 const Shape shape17(Shape17(meanshape));
266
267 const double x_meanmouth =
268 (shape17(L17_CTopOfTopLip, IX) + shape17(L17_CBotOfBotLip, IX)) / 2;
269
270 const double y_meanmouth =
271 (shape17(L17_CTopOfTopLip, IY) + shape17(L17_CBotOfBotLip, IY)) / 2;
272
273 Shape meanline(2, 2), detline(2, 2); // line from eye to mouth
274
275 meanline(0, IX) = shape17(L17_RPupil, IX); // right eye
276 meanline(0, IY) = shape17(L17_RPupil, IY);
277 meanline(1, IX) = x_meanmouth; // mouth
278 meanline(1, IY) = y_meanmouth;
279
280 detline(0, IX) = detpar.rex; // right eye
281 detline(0, IY) = detpar.rey;
282 detline(1, IX) = detpar.mouthx; // mouth
283 detline(1, IY) = detpar.mouthy;
284
285 return TransformShape(meanshape, AlignmentMat(meanline, detline));
286}
287
288static void FlipIfLeftFacing(
289 Shape& shape, // io

Callers 1

EstartEyeMouthFunction · 0.85

Calls 7

lprintfFunction · 0.85
NSIZEFunction · 0.85
PointUsedFunction · 0.85
ValidFunction · 0.85
Shape17Function · 0.85
TransformShapeFunction · 0.85
AlignmentMatFunction · 0.85

Tested by

no test coverage detected