Opencv-获取两点之间距离

转载:获取两点之间距离,作者:sunnyrainab


/************************************************************************ 

*函数名:        getDistance 

* 

*函数作用:      获取两点之间的距离 

* 

*函数参数: 

*CvPoint2D32f pointO  - 起点 

*CvPoint2D32f pointA  - 终点 

* 

*函数返回值: 

*double           两点之间的距离 

**************************************************************************/  

double getDistance (CvPoint pointO,CvPoint pointA )  

{  

    double distance;  

    distance = powf((pointO.x - pointA.x),2) + powf((pointO.y - pointA.y),2);  

    distance = sqrtf(distance);  

  

    return distance;  

}  

猜你喜欢

转载自blog.csdn.net/hi_baymax/article/details/82191845