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

Method LevSearch_

jni/stasm/asm.cpp:171–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169#endif // not _OPENMP
170
171void Mod::LevSearch_( // do an ASM search at one level in the image pyr
172 Shape& shape, // io: the face shape for this pyramid level
173 int ilev, // in: pyramid level (0 is full size)
174 const Image& img, // in: image scaled to this pyramid level
175 const Shape& pinnedshape) // in: if no rows then no pinned landmarks, else
176 // points except those equal to 0,0 are pinned
177const
178{
179 TraceShape(shape, img, ilev, 0, "enterlevsearch");
180
181 InitHatLevData(img, ilev); // init internal HAT mats for this lev
182
183 VEC b(NSIZE(shapemod_.eigvals_), 1, 0.); // eigvec weights, init to 0
184
185 for (int iter = 0; iter < SHAPEMODEL_ITERS; iter++)
186 {
187 // suggest shape by descriptor matching at each landmark
188
189 SuggestShape_(shape,
190 ilev, img, pinnedshape);
191
192 TraceShape(shape, img, ilev, iter, "suggested");
193
194 // adjust suggested shape to conform to the shape model
195
196 if (pinnedshape.rows)
197 shape = shapemod_.ConformShapeToMod_Pinned_(b,
198 shape, ilev, pinnedshape);
199 else
200 shape = shapemod_.ConformShapeToMod_(b,
201 shape, ilev);
202
203 TraceShape(shape, img, ilev, iter, "conformed");
204 }
205}
206
207static void CreatePyr( // create image pyramid
208 vector<Image>& pyr, // out: the pyramid, pyr[0] is full size image

Callers

nothing calls this directly

Calls 5

TraceShapeFunction · 0.85
InitHatLevDataFunction · 0.85
NSIZEFunction · 0.85
ConformShapeToMod_Method · 0.80

Tested by

no test coverage detected