python图片二值化提高识别率
发布时间:2020-12-20 10:53:40 所属栏目:Python 来源:网络整理
导读:import cv2 from PIL import Image from pytesseract import pytesseract from PIL import ImageEnhance import re import string def createFile(filePath,newFilePath): img = Image.open(filePath) # 模式L”为灰色图像,它的每个像素用8个bit表示,0表示
import cv2
if __name__ == ‘__main__‘: createFile(r‘1.bmp‘,r‘newTest.png‘) ?
? 原图: 处理过后的图: ? 识别结果: (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |