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

Function TraceFaces

jni/stasm/MOD_1/facedet.cpp:147–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147static void TraceFaces( // write image showing detected face rects
148 const std::vector<DetectorParameter>& detpars, // in
149 const Image& img, // in
150 const char* path) // in
151{
152#if TRACE_IMAGES // will be 0 unless debugging (defined in stasm.h)
153
154 CImage cimg; cvtColor(img, cimg, CV_GRAY2BGR); // color image
155 for (int iface = 0; iface < NSIZE(detpars); iface++)
156 {
157 const DetectorParameter &detpar = detpars[iface];
158
159 rectangle(cimg,
160 cv::Point(cvRound(detpar.x - detpar.width/2),
161 cvRound(detpar.y - detpar.height/2)),
162 cv::Point(cvRound(detpar.x + detpar.width/2),
163 cvRound(detpar.y + detpar.height/2)),
164 CV_RGB(255,255,0), 2);
165
166 ImgPrintf(cimg, // 10 * iface to minimize overplotting
167 detpar.x + 10 * iface, detpar.y,
168 C_YELLOW, 1, ssprintf("%d", iface));
169 }
170 lprintf("%s\n", path);
171 if (!cv::imwrite(path, cimg))
172 Err("Cannot write %s", path);
173#endif
174}
175
176void FaceDetector::DetectFaces_( // call once per image to find all the faces
177 const Image& img, // in: the image (grayscale)

Callers 1

DetectFaces_Method · 0.85

Calls 5

NSIZEFunction · 0.85
ImgPrintfFunction · 0.85
ssprintfFunction · 0.85
lprintfFunction · 0.85
ErrFunction · 0.85

Tested by

no test coverage detected