百度云文字识别 (AIPOcr)

匿名 (未验证) 提交于 2019-12-03 00:22:01

接下来写点关于百度云 文字识别的 笔记吧.


在这里我根据返回参数 写了几个对应的实体类来接收,





写的一个java类继承文档提供的关于文字识别操作类

public class AIPOcrJava extends AipOcr {     //璁剧疆APPID/AK/SK     public static final String APP_ID = "*********";     public static final String API_KEY = "*******************";     public static final String SECRET_KEY = "************************";      public AIPOcrJava(){super(APP_ID, API_KEY, SECRET_KEY);      this.setConnectionTimeoutInMillis(60000);      this.setSocketTimeoutInMillis(20000);         System.setProperty("aip.log4j.conf", "classpath/log4j.properties");     }      public AIPOcrJava(String aipId, String aipKey, String secretKey) {        super(aipId,aipKey,secretKey);         this.setConnectionTimeoutInMillis(60000);         this.setSocketTimeoutInMillis(60000);         System.setProperty("aip.log4j.conf", "classpath/log4j.properties")

1,通用文字识别


2,通用文字识别高精度版


3,


4

 
 // JSONObject front = idCard("D:\\BaiDuYun\\idCrdFront.jpg", "front");//  System.out.println(front.toString());  //{"log_id":3309234557215895357,"words_result":  // {"姓名":{"words":"***","location":{"top":444,"left":138,"width":172,"height":63}},  // "民族":{"words":"汉","location":{"top":574,"left":419,"width":36,"height":44}},  // "סַ":{"words":"****************","location":{"top":788,"left":125,"width":568,"height":130}},  // "公民身份号码":{"words":"************00122","location":{"top":1045,"left":361,"width":707,"height":76}},  // "出生":{"words":"******8","location":{"top":0,"left":0,"width":0,"height":0}},  // "性别":{"words":"男","location":{"top":0,"left":0,"width":0,"height":0}}},"words_result_num":6,"image_status":"normal","direction":0}




易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!