Machine Learning, Histogram Equalization.
cv2.imread('avalon_lake.jpeg') grayImage = cv2.cvtColor(originalImage, cv2.COLOR_BGR2GRAY) (thresh, blackAndWhiteImage) = cv2.threshold(grayImage, 127, 255, cv2.THRESH_BINARY) cv2.imwrite('blackAndWhiteImage.png', blackAndWhiteImage) cv2.imwrite('grayImage.png', grayImage) Original -> Gray -> BW