Skip to content

Instantly share code, notes, and snippets.

@NikaTsanka
Created July 14, 2017 17:45
Show Gist options
  • Save NikaTsanka/ffbf8cd4ca3b5fe8ce3822e033c5ca43 to your computer and use it in GitHub Desktop.
Save NikaTsanka/ffbf8cd4ca3b5fe8ce3822e033c5ca43 to your computer and use it in GitHub Desktop.
Canny Operator
import cv2
import matplotlib.pyplot as plt
# Open the image
img = cv2.imread('dancing-spider.jpg')
# Apply Canny
edges = cv2.Canny(img, 100, 200, 3, L2gradient=True)
plt.figure()
plt.title('Spider')
plt.imsave('dancing-spider-canny.png', edges, cmap='gray', format='png')
plt.imshow(edges, cmap='gray')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment