类 OCRService

java.lang.Object
plus.hiver.tess4j.service.OCRService

@Service public class OCRService extends Object
OCR服务

尊重知识产权,CV 请保留版权,海文科技 https://hiver.cc 出品,不允许非法使用,后果自负

作者:
Yazhi Li
  • 构造器详细资料

    • OCRService

      public OCRService(@Value("${tesseract.datapath}") String tessDataPath)
  • 方法详细资料

    • doOCR

      public String doOCR(org.springframework.web.multipart.MultipartFile file, String language) throws Exception
      对上传的图片文件进行 OCR 识别,返回识别出的文字
      参数:
      file - 上传的图片文件(MultipartFile)
      返回:
      识别出的文字内容
      抛出:
      Exception - 如果识别失败或文件有问题,抛出异常