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

Function calcuateFaceRegionInfo

jni/venus/region_operation.cpp:766–780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

764}
765
766RoiInfo 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
782RoiInfo calcuateEyeBrowRegionInfo(const std::vector<cv::Point2f>& points, bool right/* = true*/)
783{

Calls 2

boundingRectFunction · 0.85
RoiInfoClass · 0.70

Tested by

no test coverage detected