IndieGame/client/Assets/Plugins/zbitmap/zbitmapfont/img_to_text.py

16 lines
284 B
Python
Raw Normal View History

2024-10-22 17:38:59 +08:00
import pytesseract
import cv2
import sys
print ('参数列表:', str(sys.argv))
img = cv2.imread(sys.argv[1], cv2.IMREAD_GRAYSCALE)
# img2 = cv2.convertScaleAbs(img,alpha= (i + 1) * 2,beta=0)
img2 = img
text = pytesseract.image_to_string(img2, lang = 'chi_sim+eng')
print(text)