| 764 | } |
| 765 | |
| 766 | RoiInfo calcuateFaceRegionInfo(const std::vector<cv::Point2f>& points) |
| 767 | { |
| 768 | Rect rect = cv::boundingRect(points); |
| 769 | |
| 770 | Point2f origion = rect.tl(); |
| 771 | Point2f pivot(rect.x + rect.width/2.0f, rect.y + rect.height/2.0f); |
| 772 | |
| 773 | Mat mask(rect.size(), CV_8UC3, BACKGROUD_COLOR); |
| 774 | Point polygon[20]; |
| 775 | for(int i = 0; i < 20; ++i) |
| 776 | polygon[i] = Point(cvRound(points[i].x - rect.x), cvRound(points[i].y - rect.y)); |
| 777 | cv::fillConvexPoly(mask, polygon, NELEM(polygon), FOREGROUD_COLOR); |
| 778 | |
| 779 | return RoiInfo(origion, pivot, mask); |
| 780 | } |
| 781 | |
| 782 | RoiInfo calcuateEyeBrowRegionInfo(const std::vector<cv::Point2f>& points, bool right/* = true*/) |
| 783 | { |
no test coverage detected