Browse Source

fix: 红外算法读取温度失败时,最高低温均为-1℃,返回分析失败code2002

master v1.0.0
yinhuaiwei 1 month ago
parent
commit
ec004e9a66
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      src/main/java/com/inspect/simulator/service/impl/HikVisionServiceImpl.java

+ 5
- 2
src/main/java/com/inspect/simulator/service/impl/HikVisionServiceImpl.java View File

@ -903,6 +903,7 @@ public class HikVisionServiceImpl implements HikVisionService {
InfraredInfo drawStringMatrix = matrixTemperatureShow(c, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); InfraredInfo drawStringMatrix = matrixTemperatureShow(c, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix());
infraredInfo.setFrameMax(Math.round(drawStringMatrix.getFrameMax() * 100) / 100f); infraredInfo.setFrameMax(Math.round(drawStringMatrix.getFrameMax() * 100) / 100f);
infraredInfo.setFrameMin(Math.round(drawStringMatrix.getFrameMin() * 100) / 100f);
Integer maxTempX = drawStringMatrix.getMaxTempX(); Integer maxTempX = drawStringMatrix.getMaxTempX();
Integer maxTempY = drawStringMatrix.getMaxTempY(); Integer maxTempY = drawStringMatrix.getMaxTempY();
log.info("最高温度值坐标点:" + "maxTempX:" + maxTempX + " maxTempY:" + maxTempY); log.info("最高温度值坐标点:" + "maxTempX:" + maxTempX + " maxTempY:" + maxTempY);
@ -1542,14 +1543,16 @@ public class HikVisionServiceImpl implements HikVisionService {
//画框标注 //画框标注
String s = ImageOverlays(infraPictureInfo, infraredInfo); String s = ImageOverlays(infraPictureInfo, infraredInfo);
infraredInfo.setOutPath(s); infraredInfo.setOutPath(s);
log.info("计算过后最高温{}",infraredInfo.getFrameMax(), infraredInfo.getFrameMin());
log.info("计算过后最高温 ->是否等于0.0f{}",infraredInfo.getFrameMax() == 0.0f);
log.info("计算过后最高温:{}, 最低温:{}",infraredInfo.getFrameMax(), infraredInfo.getFrameMin());
log.info("计算过后最高温 ->是否等于0.0f {}",infraredInfo.getFrameMax() == 0.0f);
//温度未取到 //温度未取到
if(StringUtils.isNull(maxTemperature)){ if(StringUtils.isNull(maxTemperature)){
maxTemperature = "-1"; maxTemperature = "-1";
infraredInfo.setFrameMax(-1); infraredInfo.setFrameMax(-1);
infraredInfo.setFrameMin(-1);
} else if(infraredInfo.getFrameMax() == 0.0f){ } else if(infraredInfo.getFrameMax() == 0.0f){
infraredInfo.setFrameMax(Float.parseFloat((maxTemperature))); infraredInfo.setFrameMax(Float.parseFloat((maxTemperature)));
infraredInfo.setFrameMin(Float.parseFloat((minTemperature)));
} }
} else if (AlgConstants.INFRA_1800.equals(imageType)) { } else if (AlgConstants.INFRA_1800.equals(imageType)) {
//ivs1800红外图 //ivs1800红外图


Loading…
Cancel
Save