处理前图像:

  python3 验证码去噪

  处理后图像

  python3 验证码去噪

  代码

#coding:utf8
import os
from PIL import Image,ImageDraw,ImageFile
import numpy
import pytesseract
import cv2
import imagehash
class pictureIdenti:
    # 点降噪
    def clearNoise(self, img_name="D:\work\python36_crawl\pictureParser\V10.png", x=0, y=0):
        if os.path.exists(img_name):
            image = Image.open(img_name)
            image = image.convert('L')
            image = numpy.asarray(image)
            image = (image > 135) * 255
            image = Image.fromarray(image).convert('RGB')

            # image.show()
            save_name = "D:\work\python36_crawl\pictureParser\V19.png"
            image.save(save_name)
            return image

 

相关文章:

  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-09
猜你喜欢
  • 2022-12-23
  • 2021-11-03
  • 2022-02-09
  • 2022-12-23
  • 2021-06-15
  • 2021-11-16
相关资源
相似解决方案