Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- def canny(image):
- gray = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
- blur = cv2.GaussianBlur(gray, (5,5), 0)
- canny = cv2.Canny(blur, 10, 50) ##### TO BE CONFIGURED
- return canny
- imgName = 'low' #low, mid or high
- image = cv2.imread(%s.jpg'%imgName)
- canny_image = canny(image)
- closing_image = cv2.morphologyEx(canny_image, cv2.MORPH_CLOSE, np.ones((4,4), np.uint8))
- cv2.imshow('result',closing_image)
- cv2.waitKey(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement