Antal.Ai - Virtual Makeup
CvUtils.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 #include <opencv2/core/mat.hpp>
5 
8 
9 namespace core {
10  namespace image {
11 
18  void resizeRect(cv::Rect &rect, double scaleFactor);
19 
26  void createQuadraticRect(cv::Rect& r, const cv::Rect& imageRect);
27 
33  void histogramEqualization(cv::Mat &frame);
34 
35  }// namespace image
36 
37  namespace math {
38 
50  void eulerAnglesFromRotationVector(
51  const cv::Mat &rotationVector,
52  cv::Vec3d &eulerAngles
53  );
54 
61  cv::Mat eulerAnglesToRotationMatrix(const cv::Vec3f &theta);
62 
70  cv::Point3d rotatePoint(
71  const cv::Point3d& point,
72  const cv::Mat& rotationmatrix
73  );
74 
82  cv::Point perspectiveTransformPoint(
83  const cv::Point2f& pt,
84  cv::Mat & transformation
85  );
86 
96  cv::Point2d findProjectedPoint(
97  const cv::Mat &rotation_matrix,
98  const cv::Mat &translation_vector,
99  const cv::Mat camera_matrix,
100  cv::Point3d model_point
101  );
102 
111  int getBlobIntersectionArea(
112  const cv::Mat &blobImg,
113  const std::vector<cv::Point> &contour1,
114  const std::vector<cv::Point> &contour2
115  );
116 
126  void getBlobCorners(
127  const std::vector<cv::Point> &blob,
128  cv::Point &tl,
129  cv::Point &tr,
130  cv::Point &br,
131  cv::Point &bl
132  );
133 
144  float getAngleBetween(
145  cv::Point a_begin,
146  cv::Point a_end,
147  cv::Point b_begin,
148  cv::Point b_end
149  );
150 
157  cv::Point getMean(const std::vector<cv::Point>& vec);
158 
159  }// namespace math
160 } // namespace core