protected double computeCost ( List < Point2D_I32 > contour , int c0 , int c1 , int c2 , int offset ) { c1 = CircularIndex . addOffset ( c1 , offset , contour . size ( ) ) ; createLine ( c0 , c1 , contour , line0 ) ; createLine ( c1 , c2 , contour , line1 ) ; return distanceSum ( line0 , c0 , c1 , contour ) + distanceSum ( line1 , c1 , c2 , contour ) ; }
Computes the distance between the two lines defined by corner points in the contour