Created
June 17, 2019 12:19
-
-
Save wolframalpha/a67508a65b531226b5af667298879010 to your computer and use it in GitHub Desktop.
use this code for canny edge detection
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
# %matplotlib inline | |
import numpy as np | |
import cv2 as cv | |
from matplotlib import pyplot as plt | |
img = cv.imread('Sample/Sample.tif') | |
edges = cv.Canny(img,100,200) | |
plt.figure(figsize=(30, 25)) | |
# plt.subplot(121),plt.imshow(img,cmap = 'gray') | |
# plt.title('Original Image'), plt.xticks([]), plt.yticks([]) | |
# plt.subplot(122),plt.imshow(edges,cmap = 'gray') | |
# plt.title('Edge Image'), plt.xticks([]), plt.yticks([]) | |
# plt.savefig('Sample/OriginalvsCannyED.jpg') | |
plt.imshow(edges, cmap='gray') | |
plt.savefig('Sample/cannyED.jpg') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment