Browse Source

init

master
diven 2 years ago
parent
commit
7e14757b58
  1. 7
      open-anpr-core/src/main/java/com/visual/open/anpr/core/domain/PlateInfo.java
  2. 6
      open-anpr-core/src/main/java/com/visual/open/anpr/core/models/TorchPlateRecognition.java

7
open-anpr-core/src/main/java/com/visual/open/anpr/core/domain/PlateInfo.java

@ -323,14 +323,15 @@ public class PlateInfo implements Comparable<PlateInfo>, Serializable {
/**车牌颜色的分数**/
public float colorScore;
private ParseInfo(String plateNo, String plateColor, float colorScore) {
private ParseInfo(String image, String plateNo, String plateColor, float colorScore) {
this.image = image;
this.plateNo = plateNo;
this.plateColor = plateColor;
this.colorScore = colorScore;
}
public static ParseInfo build(String plateNo, String plateColor, float colorScore){
return new ParseInfo(plateNo, plateColor, colorScore);
public static ParseInfo build(String image, String plateNo, String plateColor, float colorScore){
return new ParseInfo(image, plateNo, plateColor, colorScore);
}
}
}

6
open-anpr-core/src/main/java/com/visual/open/anpr/core/models/TorchPlateRecognition.java

@ -56,7 +56,11 @@ public class TorchPlateRecognition extends BaseOnnxInfer implements PlateRecogn
double[] colorSoftMax = SoftMaxUtil.softMax(ArrayUtil.floatToDouble(color[0]));
Double[] colorRResult = decodeColor(colorSoftMax);
//返回解析到的数据
return ParseInfo.build(plateNo, PLATE_COLOR[colorRResult[0].intValue()], colorRResult[1].floatValue());
return ParseInfo.build(
image.toBase64AndNoReleaseMat(), plateNo,
PLATE_COLOR[colorRResult[0].intValue()],
colorRResult[1].floatValue()
);
}catch (Exception e){
//抛出异常
throw new RuntimeException(e);

Loading…
Cancel
Save