I attach the segmented images. As you can see the contour is not robust enough. As a result, there are gaps between the head of the tip of the spike and the rest of the body. The contour breaks and diferent pieces are created.
I don't want this. I want seamless contour with no gaps.
I also attach the code I use.
Any help appreciated.