|
|
|
@ -69,7 +69,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
String imgPath = responseBody.getString("img_path");//图片路径
|
|
|
|
|
String imgName = null;//图片名称
|
|
|
|
|
if (StringUtils.isNotBlank(imgPath)) {
|
|
|
|
|
imgName = imgPath.substring(imgPath.lastIndexOf("/"),imgPath.length());
|
|
|
|
|
imgName = imgPath.substring(imgPath.lastIndexOf("/")+1,imgPath.length());
|
|
|
|
|
}
|
|
|
|
|
String message = responseBody.getString("message");//描述
|
|
|
|
|
String taskStatus = responseBody.getString("taskStatus");//任务是否完成
|
|
|
|
@ -98,13 +98,10 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
////
|
|
|
|
|
String text;//ocr 识别的文本,
|
|
|
|
|
Double probability=0d;
|
|
|
|
|
OcrResult copyOcrResult=new OcrResult();
|
|
|
|
|
|
|
|
|
|
//用于数据结构化的对象
|
|
|
|
|
List<OcrResult> ocrResultList=new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
StringBuffer rMessage=new StringBuffer();
|
|
|
|
|
rMessage.append("<br/>");
|
|
|
|
|
Map<String,Boolean> fieldRightMap=new LinkedHashMap<>();//存放 字段判断正确map
|
|
|
|
|
//==========================
|
|
|
|
|
checkSemanticFor: for (CheckSemanticModel value : checkSemanticModelMap.values()) {
|
|
|
|
@ -128,7 +125,6 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ocrArrayFor:for (int i = 0; i < ocrArray.size(); i++) {
|
|
|
|
|
copyOcrResult=new OcrResult();
|
|
|
|
|
JSONObject ocrItem = ocrArray.get(i);
|
|
|
|
|
text = ocrItem.getString("text");//ocr 识别的文本
|
|
|
|
|
probability = ocrItem.getDouble("probability");//置信度
|
|
|
|
@ -150,8 +146,8 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
rMessage.append(field+"_未查到ocr结果,");
|
|
|
|
|
ocrResultAdd(ocrResultList,field,inputText,null,0d,imgPath,"未查到ocr结果",false);
|
|
|
|
|
rMessage.append(field+"_未查到ocr结果");
|
|
|
|
|
ocrResultAdd(ocrResultList,field,inputText,null,0d,imgPath,"ocr结果未获取",false);
|
|
|
|
|
fieldRightMap.put(field,false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|