tesseract把图片背景先变白色,再进行识别(二值化)代码
import cv2 as cvfrom PIL import Imageimport pytesseract def recognize_text(): gray = cv.cvtColor(src, cv.COLOR_BGR2GRAY) ret, binary = cv.threshold(gray, 0, 255, cv.THRESH_BINARY_INV | cv...