Python素描

import cv2

# 第一种
# image_path = r"E:\Python\sensitiveword\1.jpg"
# image_read = cv2.imread(image_path)
# image_gray = cv2.cvtColor(image_read, cv2.COLOR_RGB2GRAY)
# image_gray = cv2.medianBlur(image_gray,5)
# image_edge = cv2.adaptiveThreshold(image_gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, blockSize=3, C=2)
# cv2.imwrite("3.jpg",image_edge)

# 第二种
image_path = r"E:\Python\sensitiveword\1.jpg"
image_read = cv2.imread(image_path)
image_gray = cv2.cvtColor(image_read, cv2.COLOR_RGB2GRAY)
image_blur = cv2.GaussianBlur(image_gray, ksize=(21, 21), sigmaX=0, sigmaY=0)
image = cv2.divide(image_gray, image_blur, scale=255)
cv2.imwrite("8.jpg", image)

太简单懒得写介绍自己看代码吧

发布了6 篇原创文章 · 获赞 64 · 访问量 2万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 书香水墨 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览