Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. import cv2 as cv
  2. import numpy as np
  3.  
  4. img = cv.imread('sudoku.png',0)
  5.  
  6.  
  7. _,th1 =cv.threshold(img,127,255,cv.THRESH_BINARY)
  8.  
  9. th2=cv.adaptiveThreshold
  10. (img,255,cv.ADAPTIVE_THRESH_MEAN_C,cv.THRESH_BINARY,11,2)
  11.  
  12. cv.imshow("Image",img)
  13. cv.imshow("th1",th1)
  14. cv.imshow("th2",th2)
  15.  
  16. cv.waitKey(0)
  17. cv.destroyAllWindows()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement