Created
July 14, 2017 17:45
-
-
Save NikaTsanka/ffbf8cd4ca3b5fe8ce3822e033c5ca43 to your computer and use it in GitHub Desktop.
Canny Operator
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 | |
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