|
|
|
@ -673,7 +673,7 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
// 设置标注样式 |
|
|
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
|
|
|
// Font font = new Font("微软雅黑", Font.BOLD, 17); |
|
|
|
Font font = new Font("WenQuanYi Zen Hei", Font.BOLD, 17); |
|
|
|
Font font = new Font("WenQuanYi Zen Hei", Font.BOLD, 20); |
|
|
|
final String imageType = infraPictureInfo.getImgType(); |
|
|
|
if (AlgConstants.INFRA_YU3.equals(imageType)) { |
|
|
|
for (Coordinate c : coordinates) { |
|
|
|
@ -725,6 +725,32 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
infraPictureInfo.setSecondX(x2); |
|
|
|
infraPictureInfo.setSecondY(y2); |
|
|
|
|
|
|
|
InfraredInfo drawStringMatrix = matrixTemperatureShow(c, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); |
|
|
|
infraredInfo.setFrameMax(Math.round(drawStringMatrix.getFrameMax() * 100) / 100f); |
|
|
|
// 添加矩形标签 |
|
|
|
String line1 = "平均温度:" + String.format("%.2f", drawStringMatrix.getFrameAverage()); |
|
|
|
String line2 = "最高温度:" + String.format("%.2f", drawStringMatrix.getFrameMax()); |
|
|
|
String line3 = "最低温度:" + String.format("%.2f", drawStringMatrix.getFrameMin()); |
|
|
|
g2d.drawString(line1, rectX + 5, rectY + 15); |
|
|
|
g2d.drawString(line2, rectX + 5, rectY + 30); |
|
|
|
g2d.drawString(line3, rectX + 5, rectY + 45); |
|
|
|
}else { |
|
|
|
log.error("画框坐标超出图片范围"); |
|
|
|
// 确保x1,y1是左上角,x2,y2是右下角 |
|
|
|
int rectX = Math.min(1, 639); |
|
|
|
int rectY = Math.min(1, 511); |
|
|
|
int width = Math.abs(639 - 1); |
|
|
|
int height = Math.abs(511 - 1); |
|
|
|
|
|
|
|
// 设置更粗的画笔(加粗矩形边框) |
|
|
|
g2d.setStroke(new BasicStroke(3)); // 3像素宽 |
|
|
|
// 绘制矩形 |
|
|
|
g2d.drawRect(rectX, rectY, width, height); |
|
|
|
infraPictureInfo.setFirstX(x1); |
|
|
|
infraPictureInfo.setFirstY(y1); |
|
|
|
infraPictureInfo.setSecondX(x2); |
|
|
|
infraPictureInfo.setSecondY(y2); |
|
|
|
|
|
|
|
InfraredInfo drawStringMatrix = matrixTemperatureShow(c, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); |
|
|
|
infraredInfo.setFrameMax(Math.round(drawStringMatrix.getFrameMax() * 100) / 100f); |
|
|
|
// 添加矩形标签 |
|
|
|
@ -1379,6 +1405,7 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
floats = UploadFtpImage(hrUavUrl, null, ftpUrlName); |
|
|
|
if (floats != null && floats.length > 0 && floats[0].length > 0) { |
|
|
|
infraredInfo.setTemperatureMatrix(floats); |
|
|
|
log.info("配置的点位"+infraPictureInfo.getFirstX(),infraPictureInfo.getFirstY()); |
|
|
|
String s = ImageOverlays(infraPictureInfo, infraredInfo); |
|
|
|
infraredInfo.setOutPath(s); |
|
|
|
} else { |
|
|
|
|