赞
踩
- import cv2 as cv
-
- img=cv.imread('bookpage.jpg')
- img=cv.cvtColor(img,cv.COLOR_RGBA2GRAY)
-
- _,result=cv.threshold(img,50,255,cv.THRESH_BINARY)
-
- adaptive = cv.adaptiveThreshold(img,255,cv.ADAPTIVE_THRESH_GAUSSIAN_C,cv.THRESH_BINARY,21,4)
-
-
-
- cv.imshow('img',img)
- cv.imshow('result',result)
- cv.imshow('adaptive',adaptive)
-
- cv.waitKey(0)
- cv.destroyAllWindows()
![](https://csdnimg.cn/release/blogv2/dist/pc/img/newCodeMoreWhite.png)
短短几行代码,却能让图像发生变化amazing
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。