I need to convert the first image to the second image using python help with OpenCV. Please help me to do that!
Sample Input
Sample Output
Use this code -
import cv2
img = cv2.imread(r'image.png',1)
retval, threshold = cv2.threshold(img, 20, 255, cv2.THRESH_BINARY)
cv2.imshow("Threshold",threshold)
cv2.waitKey(0)
OUTPUT -