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

Function AlignMeanShapeToFaceDet

jni/stasm/startshape.cpp:53–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51// This ignores the eye and mouth, if any.
52
53static Shape AlignMeanShapeToFaceDet(
54 const DetectorParameter& detpar, // in
55 const Shape& meanshape, // in
56 double scale, // in: scale the face rectangle
57 const Image& img) // io: the image (grayscale)
58{
59 if (trace_g)
60 lprintf("AlignToFaceDet ");
61
62 DetectorParameter detpar1(detpar);
63
64 if (IsLeftFacing(detpar.eyaw))
65 detpar1 = FlipDetPar(detpar, img.cols);
66
67 CV_Assert(meanshape.rows > 0 && meanshape.cols == 2);
68
69 const double xscale = detpar1.width * scale / DET_FACE_WIDTH;
70 const double yscale = detpar1.height * scale / DET_FACE_WIDTH;
71
72 Shape startshape = TransformShape(meanshape,
73 xscale, 0, detpar1.x,
74 0, yscale, detpar1.y);
75
76 return startshape;
77}
78
79// Return the model meanshape aligned to both eyes and the mouth.
80//

Callers 3

EstartRectOnlyFunction · 0.85
EstartEyesFunction · 0.85
EstartEyeMouthFunction · 0.85

Calls 4

lprintfFunction · 0.85
IsLeftFacingFunction · 0.85
FlipDetParFunction · 0.85
TransformShapeFunction · 0.85

Tested by

no test coverage detected