Skip to content

Instantly share code, notes, and snippets.

@lucapiccinelli
Last active October 22, 2016 11:23
Show Gist options
  • Save lucapiccinelli/f04989f54fada39681d3449df3750f59 to your computer and use it in GitHub Desktop.
Save lucapiccinelli/f04989f54fada39681d3449df3750f59 to your computer and use it in GitHub Desktop.
import cv2
import matplotlib.pyplot as plt
#caricamento dell'immagine da disco
im = cv2.imread(r'img\text.jpg', cv2.IMREAD_GRAYSCALE)
h, w = im.shape
#ridimensionamento dell'immagine
im = cv2.resize(im, (w/3,h/3))
#canny edge detector
im = cv2.Canny(im, 100, 200)
plt.imshow(im, cmap='Greys_r')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment