Last active
February 23, 2017 11:38
-
-
Save cosmo0920/5e27eba96459051341f31766dc51a55f 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 cv2, matplotlib | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import os | |
filename='yuudachi.png' | |
filename_base, ext = os.path.splitext(filename) | |
img = cv2.imread(filename, 1) | |
kernel = np.ones((3,3),np.uint8) | |
dilate_img=cv2.dilate(img,kernel,iterations=1) | |
dilate_diff_img=cv2.absdiff(img, dilate_img) | |
cv2.imwrite(filename_base + '-linedraw' + ext, 255 - dilate_diff_img) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment