Last active
July 5, 2020 15:21
-
-
Save joschuck/86c577dfd3225c7f080e36c8b6f50d6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
image = cv2.imread('book_page_1_cropped.jpg') | |
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) | |
ret, th = cv2.threshold(gray, | |
127, # threshold value | |
255, # maximum value assigned to pixel values exceeding the threshold | |
cv2.THRESH_BINARY) # threshold method type |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment