How Convexity Defect is calculated in OpenCV?
问题 What is the algorithm used in OpenCV function convexityDefects() to calculate the convexity defects of a contour? Please, describe and illustrate the high-level operation of the algorithm, along with its inputs and outputs. 回答1: Based on the documentation, the input are two lists of coordinates: contour defining the original contour (red on the image below) convexhull defining the convex hull corresponding to that contour (blue on the image below) The algorithm works in the following manner: