赞
踩
- #coding=utf-8
- import cv2
- import numpy as np
-
- img=cv2.imread('ww.png')
- retval,thre=cv2.threshold(img,12,255,cv2.THRESH_BINARY)
-
- grayscal=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
- retval1,thre1=cv2.threshold(grayscal,12,255,cv2.THRESH_BINARY)
- gaus=cv2.adaptiveThreshold(grayscal,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C,cv2.THRESH_BINARY,155,1)
- cv2.imshow('re1',img)
- cv2.imshow('re2',thre)
- cv2.imshow('re3',thre1)
- cv2.imshow('re4',gaus)
- cv2.waitKey(0)
- cv2.destroyAllWindows()

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。