Skip to content

Instantly share code, notes, and snippets.

@lucapiccinelli
Last active March 28, 2016 19:35
Show Gist options
  • Save lucapiccinelli/1ab38a6eb8770ca0270d to your computer and use it in GitHub Desktop.
Save lucapiccinelli/1ab38a6eb8770ca0270d to your computer and use it in GitHub Desktop.
#riscalatura dell'immagine
scale = 800.0 / im.shape[1]
im = cv2.resize(im, (int(im.shape[1] * scale), int(im.shape[0] * scale)))
#blackhat
kernel = np.ones((1, 3), np.uint8)
im = cv2.morphologyEx(im, cv2.MORPH_BLACKHAT, kernel, anchor=(1, 0))
#sogliatura
thresh, im = cv2.threshold(im, 10, 255, cv2.THRESH_BINARY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment