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

Method ShapeMod

jni/stasm/shapemod.h:26–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 const;
25
26 ShapeMod( // constructor
27 const Shape& meanshape,
28 const VEC& eigvals,
29 const MAT& eigvecs,
30 const int neigs,
31 const double bmax,
32 const unsigned hackbits)
33
34 : meanshape_(meanshape),
35 eigvals_(DimKeep(eigvals, neigs, 1)),
36 eigvecs_(DimKeep(eigvecs, eigvecs.rows, neigs)), // retain neigs cols
37 // take inverse of eigvecs (by taking transpose) and retain neigs rows
38 eigvecsi_(DimKeep(eigvecs.t(), neigs, eigvecs.cols)),
39 bmax_(bmax),
40 hackbits_(hackbits)
41 {
42 if (meanshape.rows != stasm_NLANDMARKS)
43 Err("meanshape.rows %d != stasm_NLANDMARKS %d",
44 meanshape.rows, stasm_NLANDMARKS);
45 CV_Assert(meanshape.cols == 2);
46 CV_Assert(NSIZE(eigvals) == 2 * stasm_NLANDMARKS);
47 CV_Assert(eigvecs.rows == 2 * stasm_NLANDMARKS);
48 CV_Assert(eigvecs.cols == 2 * stasm_NLANDMARKS);
49 CV_Assert(neigs > 0 && neigs <= 2 * stasm_NLANDMARKS);
50 CV_Assert(bmax > 0 && bmax < 10);
51 CV_Assert((hackbits & ~(SHAPEHACKS_DEFAULT|SHAPEHACKS_SHIFT_TEMPLE_OUT)) == 0);
52 }
53
54 // all data remains constant after ShapeMod construction
55

Callers

nothing calls this directly

Calls 3

DimKeepFunction · 0.85
ErrFunction · 0.85
NSIZEFunction · 0.85

Tested by

no test coverage detected