计算向量的夹角
// 以c-pt1为起始边,c-pt2为终边,逆时针为正角度,顺时针为负角度
// 角度范围为(180)-(-180)
float computeAngelOfTwoVector(cv::Point2f pt1, cv::Point2f pt2, cv::Point2f c) {
float theta = atan2(pt1.y - c.y, pt1.x - c.x) - atan2(pt2.y - c.y, pt2.x - c.x);
if (theta > CV_PI)
theta -= 2 * CV_PI;
if (theta < -CV_PI)
theta += 2 * CV_PI;
theta = theta * 180.0 / CV_PI;
return theta;
}