将人脸框的矩形改为
void drawEllipse(cv::Mat &display, const Rect &faceRect, const cv::Scalar &color, int debounce, float cw, float acw) {
static auto origin = faceRect;
if(std::abs(origin.left - faceRect.left) > debounce ||
std::abs(origin.bottom - faceRect.bottom) > debounce) {
origin = faceRect;
}
auto rect = rr(origin);
cv::ellipse(display, rect.center, zoom(rect.size, 5), 0., 0., 360., color, 1, 16);
cv::ellipse(display, rect.center, zoom(rect.size, 4), cw, 0., 90., color, 2, 16);
cv::ellipse(display, rect.center, zoom(rect.size, 3), cw, 0., 90., color, 2, 16);
cv::ellipse(display, rect.center, zoom(rect.size, 2), cw, 0., 90., color, 2, 16);
cv::ellipse(display, rect.center, zoom(rect.size, 4), cw, 180., 270., color, 2, 16);
cv::ellipse(display, rect.center, zoom(rect.size, 3), cw, 180., 270., color, 2, 16);
cv::ellipse(display, rect.center, zoom(rect.size, 2), cw, 180., 270., color, 2, 16);
cv::ellipse(display, rect.center, zoom(rect.size, 15), acw, 50., 120., color, 1, 16);
cv::ellipse(display, rect.center, zoom(rect.size, 15), acw, 170., 240., color, 1, 16);
cv::ellipse(display, rect.center, zoom(rect.size, 15), acw, 290., 360., color, 1, 16);
}
|