import cv2
import matplotlib.pyplot as plt

image = cv2.imread('hair.jpg')
image_gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
ret, thresh = cv2.threshold(image_gray, 127, 255, 0)

plt.imshow(cv2.cvtColor(thresh, cv2.COLOR_GRAY2RGB))
plt.show()

contours = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)[1]
image = cv2.drawContours(image, cv2.COLOR_BGR2RGB)
plt.show()

# Merry Christmas
# Merry Christmas
# Merry Christmas