Skip to main content
. 2022 Feb 27;22(5):1875. doi: 10.3390/s22051875
Algorithm 3. Fragment of the Python code: function findContours().
# find countours in the mask
ctns = cv2.findContours(mask.copy(), cv2.RETR_EXTERNAL
# find the largest contour in the mask, then use
# it to compute the minimum enclosing circ
c = max(cnts, key = cv2.contourArea)
((x, y), radius) = cv2.minEnclosingCircle(c)