阿里 旷视 百度 OCR图片文字识别功能对比

阿里旷视 百度 OCR图片文字识别功能对比

因为项目中需要用到图片转文字的功能看到网上有挺多这方面的API 所以测试下哪个产品的功能更好目前选中了阿里 旷视 和百度这三家的API

图片:

 

旷视识别出来的结果

句对起

沨1当初的爱你

下面的是旷视把结果返回的json字符串

{"image_id":"AvOVDQxfja9cu+rL0mYurQ==", "result":[{"child-objects": [{"child-objects": [],"position": [{"y": 319, "x": 123},{"y": 319, "x": 137}, {"y": 333, "x":137}, {"y": 333, "x": 123}], "type":"character", "value": "m"}],"position": [], "type": "textline","value": "m"}, {"child-objects":[{"child-objects": [], "position": [{"y": 134,"x": 42}, {"y": 133, "x": 61}, {"y":153, "x": 63}, {"y": 155, "x": 43}],"type": "character", "value":"\u53e5"}, {"child-objects": [], "position":[{"y": 132, "x": 66}, {"y": 134, "x":86}, {"y": 154, "x": 84}, {"y": 152,"x": 64}], "type": "character","value": "\u5bf9"}, {"child-objects": [],"position": [{"y": 133, "x": 112},{"y": 135, "x": 133}, {"y": 156, "x":131}, {"y": 154, "x": 110}], "type": "character","value": "\u8d77"}], "position": [],"type": "textline", "value":"\u53e5\u5bf9\u8d77"}, {"child-objects": [{"child-objects":[], "position": [{"y": 136, "x": 22},{"y": 137, "x": 34}, {"y": 149, "x":33}, {"y": 149, "x": 21}], "type":"char

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是使用 Tesseract OCR 库进行图片文字识别的 Java 代码: ```java import java.io.File; import java.io.IOException; import net.sourceforge.tess4j.Tesseract; import net.sourceforge.tess4j.TesseractException; public class OCR { public static void main(String[] args) { File imageFile = new File("image.png"); Tesseract tesseract = new Tesseract(); try { String result = tesseract.doOCR(imageFile); System.out.println(result); } catch (TesseractException e) { System.err.println(e.getMessage()); } } } ``` 在这个示例中,我们使用了 Tesseract OCR 库来识别名为 `image.png` 的图像文件中的文本。请注意,要使用 Tesseract OCR 库,您需要将其添加到项目的类路径中。 您还需要将以下依赖项添加到您的项目中: ```xml <dependency> <groupId>net.sourceforge.tess4j</groupId> <artifactId>tess4j</artifactId> <version>4.5.1</version> </dependency> <dependency> <groupId>com.github.jai-imageio</groupId> <artifactId>jai-imageio-core</artifactId> <version>1.4.0</version> </dependency> <dependency> <groupId>com.github.jai-imageio</groupId> <artifactId>jai-imageio-jpeg2000</artifactId> <version>1.3.0</version> </dependency> <dependency> <groupId>com.github.jai-imageio</groupId> <artifactId>jai-imageio-metadata</artifactId> <version>1.3.0</version> </dependency> <dependency> <groupId>com.github.jai-imageio</groupId> <artifactId>jai-imageio-impl</artifactId> <version>1.3.0</version> </dependency> ``` 请注意,这些依赖项可能因版本而异。最好查看 Tesseract OCR 库的文档以获取正确的依赖项。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值