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

Function TraceEyesMouth

jni/stasm/startshape.cpp:410–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408}
409
410static void TraceEyesMouth(
411 Image& face_roi, // out: ROI around face, possibly rotated upright
412 DetectorParameter& detpar_roi) // out: detpar wrt to face_roi
413{
414#if TRACE_IMAGES // will be 0 unless debugging (defined in stasm.h)
415
416 CImage cimg;
417 cvtColor(face_roi, cimg, CV_GRAY2BGR); // color image
418 cv::rectangle(cimg,
419 cv::Point(cvRound(detpar_roi.x - .5 * detpar_roi.width),
420 cvRound(detpar_roi.y - .5 * detpar_roi.height)),
421 cv::Point(cvRound(detpar_roi.x + .5 * detpar_roi.width),
422 cvRound(detpar_roi.y + .5 * detpar_roi.height)),
423 ToCvColor(C_BLUE), 3);
424 if (Valid(detpar_roi.lex))
425 cv::circle(cimg,
426 cv::Point(cvRound(detpar_roi.lex), cvRound(detpar_roi.ley)),
427 MAX(2, face_roi.cols / 40),
428 cv::Scalar(0, 0, 255), 2);
429 if (Valid(detpar_roi.rex))
430 cv::circle(cimg,
431 cv::Point(cvRound(detpar_roi.rex), cvRound(detpar_roi.rey)),
432 MAX(2, face_roi.cols / 40),
433 cv::Scalar(0, 0, 255), 2);
434 if (Valid(detpar_roi.mouthx))
435 cv::circle(cimg,
436 cv::Point(cvRound(detpar_roi.mouthx), cvRound(detpar_roi.mouthy)),
437 MAX(2, face_roi.cols / 40),
438 cv::Scalar(0, 0, 255), 2);
439 char s[SLEN]; sprintf(s, "%s_25_eyemouth.bmp", Base(imgpath_g));
440 lprintf("%s\n", s);
441 if (!cv::imwrite(s, cimg))
442 Err("Cannot write %s", s);
443
444#endif
445}
446
447double EyeAngle( // eye angle in degrees, INVALID if eye angle not available
448 const DetectorParameter& detpar) // in: detpar wrt the ROI

Callers 1

StartShapeAndRoiFunction · 0.85

Calls 5

ToCvColorFunction · 0.85
ValidFunction · 0.85
BaseFunction · 0.85
lprintfFunction · 0.85
ErrFunction · 0.85

Tested by

no test coverage detected