I want to extract the silhouette of an image, and I\'m trying to do it using the contour function of MatplotLib. This is my code:
from PIL import Image from
I would recommand using OpenCV for performance. It has a findContour functions accessible from python using the cv2 binding. This function can be set to return only the external contour.
cv2
You will have to threshold your image as well.