Python - Pytesseract extracts incorrect text from image
问题 I used the below code in Python to extract text from image, import cv2 import numpy as np import pytesseract from PIL import Image # Path of working folder on Disk src_path = "<dir path>" def get_string(img_path): # Read image with opencv img = cv2.imread(img_path) # Convert to gray img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # Apply dilation and erosion to remove some noise kernel = np.ones((1, 1), np.uint8) img = cv2.dilate(img, kernel, iterations=1) img = cv2.erode(img, kernel, iterations