| 169 | #endif // not _OPENMP |
| 170 | |
| 171 | void 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 |
| 177 | const |
| 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 | |
| 207 | static void CreatePyr( // create image pyramid |
| 208 | vector<Image>& pyr, // out: the pyramid, pyr[0] is full size image |
nothing calls this directly
no test coverage detected