| 205 | } |
| 206 | |
| 207 | static void CreatePyr( // create image pyramid |
| 208 | vector<Image>& pyr, // out: the pyramid, pyr[0] is full size image |
| 209 | const Image& img, // in: full size image |
| 210 | int nlevs) // in |
| 211 | { |
| 212 | CV_Assert(nlevs >= 1 && nlevs < 10); // 10 is arb |
| 213 | pyr.resize(nlevs); |
| 214 | pyr[0] = img; // pyramid level 0 is full size image |
| 215 | for (int ilev = 1; ilev < nlevs; ilev++) |
| 216 | { |
| 217 | const double scale = GetPyrScale(ilev); |
| 218 | cv::resize(img, pyr[ilev], cv::Size(), scale, scale, cv::INTER_LINEAR); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | static double GetPrescale( // factor to scale face to standard size prior to search |
| 223 | const Shape& startshape) // in: startshape roughly positioned on face |
no test coverage detected