Skip to content

Instantly share code, notes, and snippets.

@matty0005
Created May 9, 2018 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matty0005/c64138bb32f90a5e193b5f242623e269 to your computer and use it in GitHub Desktop.
Save matty0005/c64138bb32f90a5e193b5f242623e269 to your computer and use it in GitHub Desktop.
getsig - Simply take a photo of your signature and instantly get a digital version.
import numpy as np
import cv2
img = cv2.imread("OrigImg.jpg",0)
kernel = np.ones((5,5), 'uint8')
ret, thresh_basic = cv2.threshold(img,155,255,cv2.THRESH_BINARY)
thresh_adapt = cv2.adaptiveThreshold(img, 255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,115,1)
erode = cv2.erode(thresh_basic,kernel,iterations=1)
cv2.imshow("Erode", erode)
cv2.imwrite("Final.jpg", erode)
cv2.waitKey(0)
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment