@@ -73,34 +73,9 @@ void unique(const std::vector<T> &A, std::vector<T> &U)
73
73
U.push_back (Tm[i]);
74
74
}
75
75
76
- template <typename T>
77
- void polyanticlockwise (std::vector<T> &points)
78
- {
79
- // Sort the points in anti-clockwise order
80
- // Trace a line between the first and second point.
81
- // If the third point is at the right side, then the points are anti-clockwise
82
- cv::Point v1 = points[1 ] - points[0 ];
83
- cv::Point v2 = points[2 ] - points[0 ];
84
-
85
- double o = (v1.x * v2.y ) - (v1.y * v2.x );
76
+ void polyanticlockwise (std::vector<cv::Point2f> &points);
77
+ void polyclockwise (std::vector<cv::Point2f> &points);
86
78
87
- if (o < 0.0 ) // if the third point is in the left side, then sort in anti-clockwise order
88
- std::swap (points[1 ], points[3 ]);
89
- }
90
- template <typename T>
91
- void polyclockwise (std::vector<T> &points)
92
- {
93
- // Sort the points in clockwise order
94
- // Trace a line between the first and second point.
95
- // If the third point is at the right side, then the points are clockwise
96
- cv::Point v1 = points[1 ] - points[0 ];
97
- cv::Point v2 = points[2 ] - points[0 ];
98
-
99
- double o = (v1.x * v2.y ) - (v1.y * v2.x );
100
-
101
- if (o > 0.0 ) // if the third point is in the left side, then sort in clockwise order
102
- std::swap (points[1 ], points[3 ]);
103
- }
104
79
// Does lexical cast of the input argument to string
105
80
template <typename T>
106
81
std::string ToString (const T &value)
0 commit comments