第一句子网 - 唯美句子、句子迷、好句子大全
第一句子网 > python文字识别像素点_Tesseract OCR 读取低分辨率/像素化字体(尤其是数字)

python文字识别像素点_Tesseract OCR 读取低分辨率/像素化字体(尤其是数字)

时间:2023-01-03 12:23:54

相关推荐

python文字识别像素点_Tesseract OCR 读取低分辨率/像素化字体(尤其是数字)

只是厌倦了使用你的小的和放大的(x4)图像馈送到Tesseract 4.0.0a。即使调整了Tesseract参数,小图像也没有输出。扩大后的一个能够OCR在所有三个案例测试-没有进一步的处理,灰度和进一步增强。在

使用的Tesseract集成到OpenCV 3.2.0中。以下是代码。在import cv2

import numpy as np

import matplotlib.pyplot as plt

%matplotlib inline

def show(img):

plt.imshow(img, cmap="gray")

plt.show()

def ocr(img):

# Tesseract mode settings:

# Page Segmentation mode (PSmode) = 3 (defualt = 3)

# OCR Enginer Mode (OEM) = 3 (defualt = 3)

tesser = cv2.text.OCRTesseract_create(C:/Program Files/Tesseract 4.0.0/tessdata/,eng,123456789,3,3)

retval = tesser.run(img, 0) # return string type

print OCR Output: + retval

# Directly feed image to Tesseact

img = cv2.imread(./imagesStackoverflow/SmallDigits-x4.png)

ocr(img)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。