I found the contours using cvfindcontour, and now I want to get the first and second contour and find the Euclidean distance between them. Can someone help me with his code?
CvPoint *contourPoint, *contourPoint2; contourPoint = (CvPoint *)CV_GET_SEQ_ELEM(CvPoint,contours,1); contourPoint2 = (CvPoint *)CV_GET_SEQ_ELEM(CvPoint,contours,2); double dis = sqrt(double((contourPoint->x - contourPoint2->x) * (contourPoint->x - contourPoint2->x) + (contourPoint->y - contourPoint2->y) * (contourPoint->y - contourPoint2->y)) );
Is it correct?
source share