我正在尝试使用pyTesseract读取字符,但方向不正确,因此我将图像每旋转1个角度旋转5角便将图像放到一个循环中,而Tesseract给出一个估计字符。问题是哪个角色才是真正的角色。我该如何学习?我可以使用Tesseract置信度吗?
img_before = cv2.imread('test.jpg')
cv2.imshow("Before", img_before)
key = cv2.waitKey(0)
angles = []
median_angle = np.median(angles)
for i in range(0,360,5):
img_rotated = ndimage.rotate(img_before, i)
cv2.imshow('rato' , img_rotated)
msg = p.image_to_string(img_rotated,config='--psm 10')
if(len(msg) <= 1):
print(msg)
cv2.waitKey(0)