jruqwhnt
This commit is contained in:
parent
ba3fa83588
commit
a1d2904701
@ -40,6 +40,9 @@ public class WebImageLocLineController {
|
|||||||
@CacheResult
|
@CacheResult
|
||||||
public R recognize(BWebImageLocRequest request) {
|
public R recognize(BWebImageLocRequest request) {
|
||||||
|
|
||||||
|
|
||||||
|
request.setRecognizeGranularity("big");
|
||||||
|
|
||||||
List<WebImageLocLineResp> respList = new ArrayList<>();
|
List<WebImageLocLineResp> respList = new ArrayList<>();
|
||||||
|
|
||||||
ApiR<BWebImageLocResp> bR = bWebImageLocHandle.handle(request);
|
ApiR<BWebImageLocResp> bR = bWebImageLocHandle.handle(request);
|
||||||
@ -57,7 +60,6 @@ public class WebImageLocLineController {
|
|||||||
WebImageLocLineResp.LocationDTO locationDTO = new WebImageLocLineResp.LocationDTO();
|
WebImageLocLineResp.LocationDTO locationDTO = new WebImageLocLineResp.LocationDTO();
|
||||||
|
|
||||||
if(wordsResultDTO.getProbability() !=null){
|
if(wordsResultDTO.getProbability() !=null){
|
||||||
|
|
||||||
probabilityDTO.setMin(wordsResultDTO.getProbability().getMin());
|
probabilityDTO.setMin(wordsResultDTO.getProbability().getMin());
|
||||||
probabilityDTO.setVariance(wordsResultDTO.getProbability().getVariance());
|
probabilityDTO.setVariance(wordsResultDTO.getProbability().getVariance());
|
||||||
probabilityDTO.setAverage(wordsResultDTO.getProbability().getAverage());
|
probabilityDTO.setAverage(wordsResultDTO.getProbability().getAverage());
|
||||||
@ -71,10 +73,29 @@ public class WebImageLocLineController {
|
|||||||
locationDTO.setHeight(wordsResultDTO.getLocation().getHeight());
|
locationDTO.setHeight(wordsResultDTO.getLocation().getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resp.setDirection(bWebImageLocResp.getDirection() + "");
|
||||||
resp.setProbability(probabilityDTO);
|
resp.setProbability(probabilityDTO);
|
||||||
resp.setLocation(locationDTO);
|
resp.setLocation(locationDTO);
|
||||||
|
|
||||||
|
|
||||||
|
List<WebImageLocLineResp.CharsDTO> chars = new ArrayList<>();
|
||||||
|
if(CollectionUtils.isNotEmpty(wordsResultDTO.getChars())){
|
||||||
|
for (BWebImageLocResp.WordsResultDTO.CharsDTO aChar : wordsResultDTO.getChars()) {
|
||||||
|
WebImageLocLineResp.CharsDTO c = new WebImageLocLineResp.CharsDTO();
|
||||||
|
c.setCharX(aChar.getCharX());
|
||||||
|
|
||||||
|
if(aChar.getLocation() !=null){
|
||||||
|
WebImageLocLineResp.CharsDTO.LocationDTO location = new WebImageLocLineResp.CharsDTO.LocationDTO();
|
||||||
|
|
||||||
|
location.setTop(aChar.getLocation().getTop());
|
||||||
|
location.setLeft(aChar.getLocation().getLeft());
|
||||||
|
location.setWidth(aChar.getLocation().getWidth());
|
||||||
|
location.setHeight(aChar.getLocation().getHeight());
|
||||||
|
c.setLocation(location);
|
||||||
|
}
|
||||||
|
chars.add(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
respList.add(resp);
|
respList.add(resp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,6 +35,9 @@ public class WebImageLocLineResp extends BaseResp {
|
|||||||
private LocationDTO location;
|
private LocationDTO location;
|
||||||
|
|
||||||
|
|
||||||
|
private CharsDTO chars;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 当 probability=true 时返回该字段。识别结果中每一行的置信度值,包含average:行置信度平均值,variance:行置信度方差,min:行置信度最小值
|
// 当 probability=true 时返回该字段。识别结果中每一行的置信度值,包含average:行置信度平均值,variance:行置信度方差,min:行置信度最小值
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@ -55,4 +58,22 @@ public class WebImageLocLineResp extends BaseResp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class CharsDTO {
|
||||||
|
private String charX;
|
||||||
|
private LocationDTO location;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class LocationDTO {
|
||||||
|
private Integer top;
|
||||||
|
private Integer left;
|
||||||
|
private Integer width;
|
||||||
|
private Integer height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user