I have an binarized image that is the contour of an object after HED edge detection and thinning with cv2.ximgproc.thinning. I would like to remove the protrusions lines from the contour. The lines have 1px

I have an binarized image that is the contour of an object after HED edge detection and thinning with cv2.ximgproc.thinning. I would like to remove the protrusions lines from the contour. The lines have 1px
