import cv2
# 第一种
# image_path = r"E:\Python\sensitiveword\"
# image_read = (image_path)
# image_gray = (image_read, cv2.COLOR_RGB2GRAY)
# image_gray = (image_gray,5)
# image_edge = (image_gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, blockSize=3, C=2)
# ("",image_edge)
# 第二种
image_path = r"E:\Python\sensitiveword\"
image_read = (image_path)
image_gray = (image_read, cv2.COLOR_RGB2GRAY)
image_blur = (image_gray, ksize=(21, 21), sigmaX=0, sigmaY=0)
image = (image_gray, image_blur, scale=255)
("", image)
太简单懒得写介绍自己看代码吧