5 #ifndef __FVG_UTILITIES__ 6 #define __FVG_UTILITIES__ 8 #include <segment_util/segmentation_util.h> 9 #include <face_video_segment.pb.h> 13 void createContours(
const segmentation::VectorMesh& mesh,
14 const segmentation::SegmentationDesc_Polygon& poly,
15 std::vector<std::vector<cv::Point>>& contours);
17 cv::Mat calcSegmentation(cv::Size size,
18 const google::protobuf::Map<google::protobuf::uint32, Region>& regions,
19 const segmentation::SegmentationDesc& seg_desc);
21 cv::Mat calcSegmentation(
const cv::Mat& face_map,
22 const google::protobuf::Map<google::protobuf::uint32, Region>& regions,
23 const segmentation::SegmentationDesc& seg_desc);
25 void postprocessSegmentation(cv::Mat& seg,
bool disconnected =
true,
26 bool holes =
true,
bool smooth =
true,
int smooth_iterations = 1,
27 int smooth_kernel_radius = 2);
40 void renderBoundaries(cv::Mat& img,
int hierarchy_level,
41 const segmentation::SegmentationDesc& desc,
42 const segmentation::Hierarchy* seg_hier,
43 const cv::Scalar& color = cv::Scalar(255, 255, 255));
45 void renderSegmentation(cv::Mat& img,
const cv::Mat& seg, uchar color);
56 void renderSegmentationBlend(cv::Mat& img,
const cv::Mat& seg,
float alpha = 0.5f,
57 const cv::Scalar& full_color = cv::Scalar(0, 0, 255),
58 const cv::Scalar& intersection_color = cv::Scalar(255, 0, 0));
60 float getFaceDominantSide(
const std::vector<cv::Point>& landmarks);
66 cv::Rect getFaceBBoxFromSegmentation(
const cv::Mat& seg,
bool square);
70 #endif // __FVG_UTILITIES__ Definition: face_regions.cpp:43