Last active
December 12, 2017 10:49
-
-
Save aagontuk/3ea00a9a07829a03bfae2ab0d2130558 to your computer and use it in GitHub Desktop.
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
import cv2 | |
import numpy as np | |
img = cv2.imread(example.jpg) | |
imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
blurred = cv2.GaussianBlur(imgGray, (5, 5), 0) | |
imgCanny = cv2.Canny(blurred, 50, 80) | |
cv2.namedWindow('Canny Edge', cv2.WINDOW_NORMAL) | |
cv2.imshow('Canny Edge', imgCanny) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment