Created
May 6, 2020 01:28
-
-
Save yutaroyamanaka/004b83db15cd587128b9e601d231b662 to your computer and use it in GitHub Desktop.
This file contains 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 sys | |
import cv2 | |
img = cv2.imread(sys.argv[1]) | |
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
ret, binary = cv2.threshold(gray, 0, 255, cv2.THRESH_OTSU) | |
print(binary.shape) | |
cv2.imwrite("output.jpg", binary) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment