Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. import cv2
  2. import numpy as np
  3.  
  4. img = cv2.imread('#IMAGE_PATH', 0)
  5. img = cv2.medianBlur(img, 5)
  6. ret, thresh =
  7. cv2.threshold(img,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
  8.  
  9. canny = cv2.Canny(thresh,100,200)
  10. cv2.imwrite("cannyt.jpg",canny)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement