返回顶部

import cv2 import pytesseract as tess image=cv2.imread("F:/mm/7") text = tess.image_to_string(image, lang="chi_sim") print(text) h, w, c = image.shape boxes = tess.image_to_boxes(image) for b in boxes.splitlines(): b = b.split(' ') image = cv2.rectangle(image, (int(b[1]), h - int(b[2])), (int(b[3]), h - int(b[4])), (0, 255, 0), 2); cv2.imshow('text detect', image) cv2.waitKey(0) cv2.destroyAllWindows() 改了一直显示不支持对象

5

0/300

评论 1

卓越助教

可能一些依赖包的版本存在一些问题 或者参考这个链接进行下修改试试: https://stackoverflow.com/questions/66741039/unsupported-image-object-while-using-tesseract

2021-10-12 16:28:25

- 没有更多了 -