16 #include "opencv2/opencv.hpp"
20 RECT_TALL = 0, RECT_SIDE = 1
24 FILETYPE_REGULAR_FILE = 0,
25 FILETYPE_DIRECTORY = 1,
26 FILETYPE_SYMBOLIC_LINK = 2,
31 rm::FileType GetFileType(
const char *filename);
33 bool ListFiles(
const char *path, std::vector<std::string> &filenames);
36 GetROI(cv::Point2f *imagePoints,
int pointsCount,
float scaleFactor = 1.0f,
const cv::Size &frameSize = {-1, -1},
37 const cv::Rect &previous = {0, 0, 0, 0});
39 cv::Rect GetROI(cv::Point2f *imagePoints,
int pointsCount,
const cv::Size2f &scaleFactor = {1, 1},
40 const cv::Size &frameSize = {-1, -1},
const cv::Rect &previous = {0, 0, 0, 0});
46 void VerticesRectify(cv::RotatedRect &input, cv::Point2f *output, RectType type);
52 void CalcPerspective(cv::Point2f input[4], cv::Point2f output[4],
float outRatio = 1.0f);
60 double NewtonIteration(
double (*fd)(
double),
double x0 = 0,
double error = 0.0001,
int cycle = 1024);
70 NewtonIteration(
double (*fd)(
double, std::vector<double>),
const std::vector<double> &literals,
double x0 = 0,
71 double error = 0.0001,
int cycle = 1024);
85 float PointDistance(
const cv::Point2f &pt1,
const cv::Point2f &pt2);
91 float PointDistance(
const cv::Point2i &pt1,
const cv::Point2i &pt2);
97 cv::Point2f
LineCenter(
const cv::Point2f &pt1,
const cv::Point2f &pt2);
106 ExtendCord(
const cv::Point2f &pt1,
const cv::Point2f &pt2,
float deltaLen, cv::Point2f &dst1, cv::Point2f &dst2);
108 std::string PathCombine(
const std::string &path1,
const std::string &path2);
110 std::string int2str(
int number);
113 #endif //RMCV_UTILS_H