Код: Выделить всё
for c in contours:
# # Filter contours based on length
if cv.arcLength(c, True) < image_length * 0.1:
continue
# Check if contour touches the image border
touches_border = False
for point in c:
x, y = point[0]
if x = height - 1:
touches_border = True
break
if touches_border:
continue # Skip contours that touch the border
Подробнее здесь: https://stackoverflow.com/questions/796 ... ith-opencv