我试着从附件中提取号码
[
但我没有得到数字8作为输出.我try 了不同的PSM值,以及6,10等.
这就是我目前所拥有的:
image = cv2.imread(image_path)
if(image is not None):
# Convert the image to grayscale
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Use OCR to extract text from the image
extracted_text = pytesseract.image_to_string(gray, config='--psm 10 -c tessedit_char_whitelist=0123456789')