static ContourConvexity ProcessContour(Contour contour) { Seq convexHull = null; Seq convexityDefects = null; if (contour != null) { var convexHullIndices = CV.ConvexHull2(contour); convexHull = CV.ConvexHull2(contour, returnPoints: true); convexityDefects = CV.ConvexityDefects(contour, convexHullIndices); } return(new ContourConvexity(contour, convexHull, convexityDefects)); }