Created
June 15, 2019 19:58
-
-
Save rostegg/193a21d99f21c5247369556cade9a028 to your computer and use it in GitHub Desktop.
Remove watermark from image
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 | |
img = cv2.imread("in.jpg", 0) | |
(thresh, img_dark) = cv2.threshold(img, 128, 255,cv2.THRESH_BINARY|cv2.THRESH_OTSU) | |
img_dark = 255 - img_dark | |
img_no_watermark = 255 - img_dark | |
cv2.imwrite("out.jpg", img_no_watermark) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment