48 #ifndef ROTATE_IMAGE_H
49 #define ROTATE_IMAGE_H
52 #include <opencv2/features2d/features2d.hpp>
53 #include <opencv2/highgui/highgui.hpp>
54 #include <opencv2/imgproc/imgproc.hpp>
55 #include <opencv2/calib3d/calib3d.hpp>
56 #include <opencv2/nonfree/nonfree.hpp>
57 #include <opencv2/core/core.hpp>
58 #include <opencv2/opencv.hpp>
81 static void rotate_image(Mat & src, Mat & dst,
const double degree);
86 static double round(
double number);
88 static double degreeToRadian(
double degree);
90 static double radianToDegree(
double radian);
92 static Size rotationNewCanvasSize(
double degree,
double angle,
double h);
94 static double solveEquationY(
Equ e,
double x);
96 static double solveEquationX(
Equ e,
double y);
98 static map<string,int> rotationExtraMargins(Size &original, Size &newSize);
100 static map<string,Point> getCorners(Size &original,map<string,int> &margins);
102 static map<string,Point> getProjectedCorners(Size &s,
double h,
double degree,
double angle);
104 static Point getCentreBetweenPoints(Point &a, Point &b) ;
106 static map<string,Point> getCentreBetweenOriginalsAndProjections(map<string,Point> &originals,map<string,Point> &projections);
108 static Equ getLinearEquation(Point &a,Point &b);
110 static Equ getPerpendicular(
Equ e,Point p);
112 static map<string,Equ> getLinearEquationBetweenOriginalsAndProjections(map<string,Point> &originals,map<string,Point> &projections);
114 static map<string,Equ> getPerpendicularLinearEquation(map<string,Point> &originals,map<string,Point> &projections,map<string,Point> ¢re);
116 static Point getColisionPoint(
Equ e1,
Equ e2);
121 #endif // ROTATE_IMAGE_H