aspose.ocr 的图片识别

操作aspose.ocr版本

  
	  aspose
	  ocr
	  23.7.1-SNAPSHOT
  

官网下载地址

https://releases.aspose.com/ocr/java/

记录一些简单的识别图片操作

首先需要导入相关依赖

<dependency>
    <groupId>com.microsoft.onnxruntime</groupId>
    <artifactId>onnxruntime</artifactId>
    <version>1.15.1</version>
</dependency>

基础的识别代码

  AsposeOCR api = new AsposeOCR();
    RecognitionSettings recognitionSettings = new RecognitionSettings();
    recognitionSettings.setLinesFiltration(true);
    recognitionSettings.setDetectAreasMode(DetectAreasMode.PHOTO);
    recognitionSettings.setAllowedCharacters(CharactersAllowedType.ALL);
    recognitionSettings.setLanguage(Language.Chi);
    RecognitionResult result = api.RecognizePage("D:\\java\\work\\test\\src\\main\\resources\\2.png", recognitionSettings);
    System.out.println("Recognition result:\n" + result.recognitionText + "\n\n");

你可能感兴趣的:(aspose,ocr)