|
|
|
@ -9,14 +9,13 @@ import com.alibaba.fastjson.JSONException; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.fasterxml.jackson.databind.JsonNode; |
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import com.inspect.simulator.domain.Infrared.Camera; |
|
|
|
import com.inspect.simulator.domain.Infrared.Coordinate; |
|
|
|
import com.inspect.simulator.domain.Infrared.InfraredInfo; |
|
|
|
import com.inspect.simulator.domain.Infrared.NvrInfo; |
|
|
|
import com.inspect.simulator.domain.Infrared.*; |
|
|
|
import com.inspect.simulator.domain.basedata.BasedataEqpBookChannel; |
|
|
|
import com.inspect.simulator.hikVision.utils.AjaxResult; |
|
|
|
import com.inspect.simulator.hikVision.utils.StringUtils; |
|
|
|
import com.inspect.simulator.hikVision.utils.jna.HikVisionUtils; |
|
|
|
import com.inspect.simulator.hikVision.utils.jna.HCNetSDK; |
|
|
|
import com.inspect.simulator.mapper.BasedataEqpBookChannelMapper; |
|
|
|
import com.inspect.simulator.service.HikVisionService; |
|
|
|
import com.inspect.simulator.utils.sftp.SftpClient; |
|
|
|
import com.sun.jna.ptr.IntByReference; |
|
|
|
@ -87,6 +86,9 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
@Resource |
|
|
|
private SftpClient sftpClient; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private BasedataEqpBookChannelMapper basedataEqpBookChannelMapper; |
|
|
|
|
|
|
|
// @Override |
|
|
|
// public AjaxResult login(NvrInfo nvrInfo) { |
|
|
|
// return login_V40(nvrInfo); |
|
|
|
@ -294,58 +296,42 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
// return AjaxResult.success(infraredInfo); |
|
|
|
// } |
|
|
|
@Override |
|
|
|
public AjaxResult capturePicture(Coordinate coordinate) { |
|
|
|
|
|
|
|
InfraredInfo infraredInfo = new InfraredInfo(); |
|
|
|
try { |
|
|
|
String imagePath = coordinate.getFilePath(); |
|
|
|
// String imagePath = "/images/ir_test.jpg"; |
|
|
|
InputStream inputStream = downloadFtp(imagePath); |
|
|
|
String protocol = hrFtpUrl.substring(0, 6); // "ftp://" |
|
|
|
String withoutProtocol = hrFtpUrl.substring(6); // "zthr02:zthr02@123.184.14.138:50021/" |
|
|
|
String[] userAndHost = withoutProtocol.split("@"); |
|
|
|
if (userAndHost.length != 2) { |
|
|
|
throw new IllegalArgumentException("URL 格式错误,缺少 @ 分隔符"); |
|
|
|
} |
|
|
|
String[] userPass = userAndHost[0].split(":"); |
|
|
|
String username = userPass[0]; |
|
|
|
String password = userPass[1]; |
|
|
|
String hostPort = userAndHost[1].replace("/", ""); // 移除末尾的 "/" |
|
|
|
String[] hostAndPort = hostPort.split(":"); |
|
|
|
String host = hostAndPort[0]; |
|
|
|
int port = Integer.parseInt(hostAndPort[1]); |
|
|
|
|
|
|
|
String imageName = Paths.get(imagePath).getFileName().toString(); |
|
|
|
pic2Ftp(imageName,inputStream,host,port,username,password); |
|
|
|
String ftpUrlName = "[\"" + hrFtpUrl + imageName + "\"]"; |
|
|
|
|
|
|
|
|
|
|
|
if (coordinate.getImgType() == 1) { |
|
|
|
byte[] imageBytes = Files.readAllBytes(Paths.get(imagePath)); |
|
|
|
infraredInfo = readDataHw(imageBytes, coordinate); |
|
|
|
} else if (coordinate.getImgType() == 2) { |
|
|
|
|
|
|
|
String s = ImageOverlaysIvs(coordinate, infraredInfo); |
|
|
|
infraredInfo.setOutPath(s); |
|
|
|
} else if (coordinate.getImgType() == 3) { |
|
|
|
//sdk版本调用x86_32 |
|
|
|
//float[][] imageTem = djService.getImageTem(coordinate.getFilePath()); |
|
|
|
|
|
|
|
//调用华软接口 |
|
|
|
float[][] imageTem = UploadFtpImage(hrUavUrl, null, ftpUrlName); |
|
|
|
if (imageTem != null && imageTem.length > 0 && imageTem[0].length > 0) { |
|
|
|
infraredInfo.setTemperatureMatrix(imageTem); |
|
|
|
String s = ImageOverlaysUav(coordinate, infraredInfo); |
|
|
|
infraredInfo.setOutPath(s); |
|
|
|
} else { |
|
|
|
return AjaxResult.error("温度解析错误!"); |
|
|
|
public AjaxResult capturePicture(InfraPictureInfo infraPictureInfo) { |
|
|
|
log.info("capturePicture, coordinate:{}", infraPictureInfo); |
|
|
|
if (infraPictureInfo.getImgType() == 1) { |
|
|
|
return AjaxResult.success("设置成功"); |
|
|
|
} else if (infraPictureInfo.getImgType() == 2) { |
|
|
|
return AjaxResult.success("设置成功"); |
|
|
|
} else if (infraPictureInfo.getImgType() == 3) { |
|
|
|
Long channelId = infraPictureInfo.getChannelId(); |
|
|
|
channelId = 1299L; |
|
|
|
BasedataEqpBookChannel basedataEqpBookChannel = basedataEqpBookChannelMapper.selectBasedataEqpBookChannelByChannelId(channelId); |
|
|
|
if (basedataEqpBookChannel != null) { |
|
|
|
int firstX = 0; |
|
|
|
int firstY = 0; |
|
|
|
int secondX = 512; |
|
|
|
int secondY = 640; |
|
|
|
int imgWidth = 640; |
|
|
|
int imgHeight = 512; |
|
|
|
if(infraPictureInfo.getCoordinates() != null && !infraPictureInfo.getCoordinates().isEmpty()) { |
|
|
|
firstX = infraPictureInfo.getCoordinates().get(0).getFirstX(); |
|
|
|
firstY = infraPictureInfo.getCoordinates().get(0).getFirstY(); |
|
|
|
secondX = infraPictureInfo.getCoordinates().get(0).getSecondX(); |
|
|
|
secondY = infraPictureInfo.getCoordinates().get(0).getSecondY(); |
|
|
|
imgWidth = infraPictureInfo.getImgHeight(); |
|
|
|
imgHeight = infraPictureInfo.getImgWidth(); |
|
|
|
} |
|
|
|
|
|
|
|
String channelContent = firstX + "," + firstY + "," + secondX + "," + secondY + "," + imgWidth + "," + imgHeight; |
|
|
|
basedataEqpBookChannel.setChannelContent(channelContent); |
|
|
|
basedataEqpBookChannelMapper.updateBasedataEqpBookChannel(basedataEqpBookChannel); |
|
|
|
return AjaxResult.success("设置成功"); |
|
|
|
} else { |
|
|
|
return AjaxResult.error("点位不存在"); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
return AjaxResult.error(); |
|
|
|
} else { |
|
|
|
return AjaxResult.error("不支持该类型"); |
|
|
|
} |
|
|
|
return AjaxResult.success(infraredInfo); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -466,8 +452,8 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
// } |
|
|
|
//绘制框选标识 |
|
|
|
if (coordinate != null) { |
|
|
|
String s = ImageOverlaysNvr(coordinate, infraredInfo); |
|
|
|
infraredInfo.setOutPath(s); |
|
|
|
//String s = ImageOverlaysNvr(coordinate, infraredInfo); |
|
|
|
//infraredInfo.setOutPath(s); |
|
|
|
} |
|
|
|
} else { |
|
|
|
System.err.println("错误:剩余数据不足以解析环境参数"); |
|
|
|
@ -479,30 +465,30 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
} |
|
|
|
|
|
|
|
//点测温 |
|
|
|
public InfraredInfo PointTemperatureShow(Coordinate coordinate, short width, short height, float[][] temperatureMatrix) { |
|
|
|
InfraredInfo infraredInfo = new InfraredInfo(); |
|
|
|
// 获取指定坐标的温度 |
|
|
|
if (ObjectUtil.isNotEmpty(coordinate.getFirstX())) { |
|
|
|
if (coordinate.getImgType() != 3) {//无人机不需要对比底图 |
|
|
|
//比例缩放像素 获取底图温度值 |
|
|
|
double xMultiple = (coordinate.getImgWidth().doubleValue() / width) * 100 / 100.0; |
|
|
|
double yMultiple = (coordinate.getImgHeight().doubleValue() / height) * 100 / 100.0; |
|
|
|
|
|
|
|
int x = (int) (coordinate.getFirstX() / xMultiple); |
|
|
|
int y = (int) (coordinate.getFirstY() / yMultiple); |
|
|
|
coordinate.setFirstX(x); |
|
|
|
coordinate.setFirstY(y); |
|
|
|
} |
|
|
|
|
|
|
|
if (coordinate.getFirstX() >= 0 && coordinate.getFirstX() <= width && coordinate.getFirstY() >= 0 && coordinate.getFirstY() <= height) { |
|
|
|
float pointTemperature = temperatureMatrix[coordinate.getFirstY()][coordinate.getFirstX()]; // 注意:y是行,x是列 |
|
|
|
infraredInfo.setPointTemperature(pointTemperature); |
|
|
|
} else { |
|
|
|
System.err.println("错误:坐标超出范围"); |
|
|
|
} |
|
|
|
} |
|
|
|
return infraredInfo; |
|
|
|
} |
|
|
|
// public InfraredInfo PointTemperatureShow(Coordinate coordinate, short width, short height, float[][] temperatureMatrix) { |
|
|
|
// InfraredInfo infraredInfo = new InfraredInfo(); |
|
|
|
// // 获取指定坐标的温度 |
|
|
|
// if (ObjectUtil.isNotEmpty(coordinate.getFirstX())) { |
|
|
|
// if (coordinate.getImgType() != 3) {//无人机不需要对比底图 |
|
|
|
// //比例缩放像素 获取底图温度值 |
|
|
|
// double xMultiple = (coordinate.getImgWidth().doubleValue() / width) * 100 / 100.0; |
|
|
|
// double yMultiple = (coordinate.getImgHeight().doubleValue() / height) * 100 / 100.0; |
|
|
|
// |
|
|
|
// int x = (int) (coordinate.getFirstX() / xMultiple); |
|
|
|
// int y = (int) (coordinate.getFirstY() / yMultiple); |
|
|
|
// coordinate.setFirstX(x); |
|
|
|
// coordinate.setFirstY(y); |
|
|
|
// } |
|
|
|
// |
|
|
|
// if (coordinate.getFirstX() >= 0 && coordinate.getFirstX() <= width && coordinate.getFirstY() >= 0 && coordinate.getFirstY() <= height) { |
|
|
|
// float pointTemperature = temperatureMatrix[coordinate.getFirstY()][coordinate.getFirstX()]; // 注意:y是行,x是列 |
|
|
|
// infraredInfo.setPointTemperature(pointTemperature); |
|
|
|
// } else { |
|
|
|
// System.err.println("错误:坐标超出范围"); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// return infraredInfo; |
|
|
|
// } |
|
|
|
|
|
|
|
//框选温度值计算 |
|
|
|
public InfraredInfo matrixTemperatureShow(Coordinate coordinate, short width, short height, float[][] temperatureMatrix) { |
|
|
|
@ -510,21 +496,22 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
//存储框选矩阵温度值 |
|
|
|
List<Float> values = new ArrayList<>(); |
|
|
|
if (ObjectUtil.isNotEmpty(coordinate.getFirstX()) && ObjectUtil.isNotEmpty(coordinate.getSecondX())) { |
|
|
|
if (coordinate.getImgType() != 3) {//无人机不需要对比底图 |
|
|
|
//倍数计算 |
|
|
|
double xMultiple = (coordinate.getImgWidth().doubleValue() / width) * 100 / 100.0; |
|
|
|
double yMultiple = (coordinate.getImgHeight().doubleValue() / height) * 100 / 100.0; |
|
|
|
|
|
|
|
//比例缩放像素 获取底图温度值 |
|
|
|
int x1 = (int) (coordinate.getFirstX() / xMultiple); |
|
|
|
int y1 = (int) (coordinate.getFirstY() / yMultiple); |
|
|
|
int x2 = (int) (coordinate.getSecondX() / xMultiple); |
|
|
|
int y2 = (int) (coordinate.getSecondY() / yMultiple); |
|
|
|
coordinate.setFirstX(x1); |
|
|
|
coordinate.setFirstY(y1); |
|
|
|
coordinate.setSecondX(x2); |
|
|
|
coordinate.setSecondY(y2); |
|
|
|
} |
|
|
|
//if (coordinate.getImgType() != 3) |
|
|
|
// {//无人机不需要对比底图 |
|
|
|
// //倍数计算 |
|
|
|
// double xMultiple = (coordinate.getImgWidth().doubleValue() / width) * 100 / 100.0; |
|
|
|
// double yMultiple = (coordinate.getImgHeight().doubleValue() / height) * 100 / 100.0; |
|
|
|
// |
|
|
|
// //比例缩放像素 获取底图温度值 |
|
|
|
// int x1 = (int) (coordinate.getFirstX() / xMultiple); |
|
|
|
// int y1 = (int) (coordinate.getFirstY() / yMultiple); |
|
|
|
// int x2 = (int) (coordinate.getSecondX() / xMultiple); |
|
|
|
// int y2 = (int) (coordinate.getSecondY() / yMultiple); |
|
|
|
// coordinate.setFirstX(x1); |
|
|
|
// coordinate.setFirstY(y1); |
|
|
|
// coordinate.setSecondX(x2); |
|
|
|
// coordinate.setSecondY(y2); |
|
|
|
// } |
|
|
|
|
|
|
|
if (coordinate.getSecondX() != 0 && coordinate.getSecondY() != 0) { |
|
|
|
for (int j = coordinate.getFirstY(); j <= coordinate.getSecondY(); j++) { // 列 |
|
|
|
@ -608,238 +595,238 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
|
|
|
|
|
|
|
|
//图片标注__nvr |
|
|
|
public String ImageOverlaysNvr(Coordinate coordinate, InfraredInfo infraredInfo) { |
|
|
|
|
|
|
|
Coordinate[] coordinates = coordinate.getCoordinates(); |
|
|
|
|
|
|
|
Date date = new Date(); |
|
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); |
|
|
|
String markPicName = sf.format(date); |
|
|
|
// 图片路径(请替换为实际路径) |
|
|
|
String imagePath = coordinate.getFilePath(); |
|
|
|
// 获取文件名(不含扩展名) |
|
|
|
File file = new File(imagePath); |
|
|
|
String fileName = file.getName(); |
|
|
|
String pureName = fileName.substring(0, fileName.lastIndexOf('.')); |
|
|
|
String filename = picPath; |
|
|
|
String outputPath = picPath + pureName + "_" + markPicName + ".jpg"; |
|
|
|
//判断路径是否存在 |
|
|
|
File filePath = new File(filename); |
|
|
|
if (!filePath.exists()) { |
|
|
|
//不存在,创建目录 |
|
|
|
filePath.mkdirs(); |
|
|
|
} |
|
|
|
try { |
|
|
|
// 加载原始图片 |
|
|
|
BufferedImage originalImage = ImageIO.read(new File(imagePath)); |
|
|
|
if (originalImage == null) { |
|
|
|
System.err.println("无法加载图片: " + imagePath); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
// 创建可编辑的图片副本 |
|
|
|
BufferedImage annotatedImage = new BufferedImage( |
|
|
|
originalImage.getWidth(), |
|
|
|
originalImage.getHeight(), |
|
|
|
BufferedImage.TYPE_INT_RGB |
|
|
|
); |
|
|
|
// 绘制原始图片 |
|
|
|
Graphics2D g2d = annotatedImage.createGraphics(); |
|
|
|
g2d.drawImage(originalImage, 0, 0, null); |
|
|
|
|
|
|
|
// 设置标注样式 |
|
|
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
|
|
|
Font font = new Font("微软雅黑", Font.BOLD, 17); |
|
|
|
|
|
|
|
for (Coordinate c : coordinates) { |
|
|
|
|
|
|
|
//点标注 |
|
|
|
if (c.getFirstX() != null && c.getFirstY() != null && c.getSecondX() == null && c.getSecondY() == null) { |
|
|
|
g2d.setFont(font); |
|
|
|
// 标注点坐标 |
|
|
|
g2d.setColor(Color.GREEN); |
|
|
|
int x = c.getFirstX(); |
|
|
|
int y = c.getFirstY(); |
|
|
|
|
|
|
|
// 确保坐标在图片范围内 |
|
|
|
if (x >= 0 && x < originalImage.getWidth() && |
|
|
|
y >= 0 && y < originalImage.getHeight()) { |
|
|
|
// 绘制点(用实心圆表示) |
|
|
|
g2d.fillOval(x - 3, y - 3, 6, 6); |
|
|
|
coordinate.setFirstX(x); |
|
|
|
coordinate.setFirstY(y); |
|
|
|
InfraredInfo drawStringPoint = PointTemperatureShow(coordinate, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); |
|
|
|
// 添加坐标标签 |
|
|
|
g2d.drawString("(" + String.format("%.2f", drawStringPoint.getPointTemperature()) + ")", x + 8, y - 8); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//矩阵标注 |
|
|
|
if (c.getSecondX() != null && c.getSecondY() != null) { |
|
|
|
// 标注矩形(每两个点确定一个矩形) |
|
|
|
g2d.setColor(Color.RED); |
|
|
|
int x1 = c.getFirstX(); |
|
|
|
int y1 = c.getFirstY(); |
|
|
|
int x2 = c.getSecondX(); |
|
|
|
int y2 = c.getSecondY(); |
|
|
|
|
|
|
|
// 确保坐标在图片范围内 |
|
|
|
if (x1 >= 0 && x1 < originalImage.getWidth() && y1 >= 0 && y1 < originalImage.getHeight() && |
|
|
|
x2 >= 0 && x2 < originalImage.getWidth() && y2 >= 0 && y2 < originalImage.getHeight()) { |
|
|
|
|
|
|
|
// 确保x1,y1是左上角,x2,y2是右下角 |
|
|
|
int rectX = Math.min(x1, x2); |
|
|
|
int rectY = Math.min(y1, y2); |
|
|
|
int width = Math.abs(x2 - x1); |
|
|
|
int height = Math.abs(y2 - y1); |
|
|
|
// 绘制矩形 |
|
|
|
g2d.drawRect(rectX, rectY, width, height); |
|
|
|
|
|
|
|
coordinate.setFirstX(x1); |
|
|
|
coordinate.setFirstY(y1); |
|
|
|
coordinate.setSecondX(x2); |
|
|
|
coordinate.setSecondY(y2); |
|
|
|
|
|
|
|
InfraredInfo drawStringMatrix = matrixTemperatureShow(coordinate, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); |
|
|
|
infraredInfo.setFrameMax(Math.round(drawStringMatrix.getFrameMax() * 100) / 100f); |
|
|
|
// 添加矩形标签 |
|
|
|
g2d.drawString("平均温度:" + String.format("%.2f", drawStringMatrix.getFrameAverage()) + |
|
|
|
"最高温度:" + String.format("%.2f", drawStringMatrix.getFrameMax()) + |
|
|
|
"最低温度:" + String.format("%.2f", drawStringMatrix.getFrameMin()), rectX + 5, rectY + 15); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
g2d.dispose(); |
|
|
|
// 保存标注后的图片 |
|
|
|
File outputFile = new File(outputPath); |
|
|
|
// 确保输出目录存在 |
|
|
|
outputFile.getParentFile().mkdirs(); |
|
|
|
|
|
|
|
ImageIO.write(annotatedImage, "jpg", outputFile); |
|
|
|
// System.out.println("标注后的图片已保存到: " + outputPath); |
|
|
|
|
|
|
|
} catch (IOException e) { |
|
|
|
System.err.println("处理图片时出错: " + e.getMessage()); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
return outputPath; |
|
|
|
} |
|
|
|
// public String ImageOverlaysNvr(Coordinate coordinate, InfraredInfo infraredInfo) { |
|
|
|
// |
|
|
|
// Coordinate[] coordinates = coordinate.getCoordinates(); |
|
|
|
// |
|
|
|
// Date date = new Date(); |
|
|
|
// SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); |
|
|
|
// String markPicName = sf.format(date); |
|
|
|
// // 图片路径(请替换为实际路径) |
|
|
|
// String imagePath = coordinate.getFilePath(); |
|
|
|
// // 获取文件名(不含扩展名) |
|
|
|
// File file = new File(imagePath); |
|
|
|
// String fileName = file.getName(); |
|
|
|
// String pureName = fileName.substring(0, fileName.lastIndexOf('.')); |
|
|
|
// String filename = picPath; |
|
|
|
// String outputPath = picPath + pureName + "_" + markPicName + ".jpg"; |
|
|
|
// //判断路径是否存在 |
|
|
|
// File filePath = new File(filename); |
|
|
|
// if (!filePath.exists()) { |
|
|
|
// //不存在,创建目录 |
|
|
|
// filePath.mkdirs(); |
|
|
|
// } |
|
|
|
// try { |
|
|
|
// // 加载原始图片 |
|
|
|
// BufferedImage originalImage = ImageIO.read(new File(imagePath)); |
|
|
|
// if (originalImage == null) { |
|
|
|
// System.err.println("无法加载图片: " + imagePath); |
|
|
|
// return null; |
|
|
|
// } |
|
|
|
// |
|
|
|
// // 创建可编辑的图片副本 |
|
|
|
// BufferedImage annotatedImage = new BufferedImage( |
|
|
|
// originalImage.getWidth(), |
|
|
|
// originalImage.getHeight(), |
|
|
|
// BufferedImage.TYPE_INT_RGB |
|
|
|
// ); |
|
|
|
// // 绘制原始图片 |
|
|
|
// Graphics2D g2d = annotatedImage.createGraphics(); |
|
|
|
// g2d.drawImage(originalImage, 0, 0, null); |
|
|
|
// |
|
|
|
// // 设置标注样式 |
|
|
|
// g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
|
|
|
// Font font = new Font("微软雅黑", Font.BOLD, 17); |
|
|
|
// |
|
|
|
// for (Coordinate c : coordinates) { |
|
|
|
// |
|
|
|
// //点标注 |
|
|
|
// if (c.getFirstX() != null && c.getFirstY() != null && c.getSecondX() == null && c.getSecondY() == null) { |
|
|
|
// g2d.setFont(font); |
|
|
|
// // 标注点坐标 |
|
|
|
// g2d.setColor(Color.GREEN); |
|
|
|
// int x = c.getFirstX(); |
|
|
|
// int y = c.getFirstY(); |
|
|
|
// |
|
|
|
// // 确保坐标在图片范围内 |
|
|
|
// if (x >= 0 && x < originalImage.getWidth() && |
|
|
|
// y >= 0 && y < originalImage.getHeight()) { |
|
|
|
// // 绘制点(用实心圆表示) |
|
|
|
// g2d.fillOval(x - 3, y - 3, 6, 6); |
|
|
|
// coordinate.setFirstX(x); |
|
|
|
// coordinate.setFirstY(y); |
|
|
|
// InfraredInfo drawStringPoint = PointTemperatureShow(coordinate, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); |
|
|
|
// // 添加坐标标签 |
|
|
|
// g2d.drawString("(" + String.format("%.2f", drawStringPoint.getPointTemperature()) + ")", x + 8, y - 8); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// |
|
|
|
// //矩阵标注 |
|
|
|
// if (c.getSecondX() != null && c.getSecondY() != null) { |
|
|
|
// // 标注矩形(每两个点确定一个矩形) |
|
|
|
// g2d.setColor(Color.RED); |
|
|
|
// int x1 = c.getFirstX(); |
|
|
|
// int y1 = c.getFirstY(); |
|
|
|
// int x2 = c.getSecondX(); |
|
|
|
// int y2 = c.getSecondY(); |
|
|
|
// |
|
|
|
// // 确保坐标在图片范围内 |
|
|
|
// if (x1 >= 0 && x1 < originalImage.getWidth() && y1 >= 0 && y1 < originalImage.getHeight() && |
|
|
|
// x2 >= 0 && x2 < originalImage.getWidth() && y2 >= 0 && y2 < originalImage.getHeight()) { |
|
|
|
// |
|
|
|
// // 确保x1,y1是左上角,x2,y2是右下角 |
|
|
|
// int rectX = Math.min(x1, x2); |
|
|
|
// int rectY = Math.min(y1, y2); |
|
|
|
// int width = Math.abs(x2 - x1); |
|
|
|
// int height = Math.abs(y2 - y1); |
|
|
|
// // 绘制矩形 |
|
|
|
// g2d.drawRect(rectX, rectY, width, height); |
|
|
|
// |
|
|
|
// coordinate.setFirstX(x1); |
|
|
|
// coordinate.setFirstY(y1); |
|
|
|
// coordinate.setSecondX(x2); |
|
|
|
// coordinate.setSecondY(y2); |
|
|
|
// |
|
|
|
// InfraredInfo drawStringMatrix = matrixTemperatureShow(coordinate, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); |
|
|
|
// infraredInfo.setFrameMax(Math.round(drawStringMatrix.getFrameMax() * 100) / 100f); |
|
|
|
// // 添加矩形标签 |
|
|
|
// g2d.drawString("平均温度:" + String.format("%.2f", drawStringMatrix.getFrameAverage()) + |
|
|
|
// "最高温度:" + String.format("%.2f", drawStringMatrix.getFrameMax()) + |
|
|
|
// "最低温度:" + String.format("%.2f", drawStringMatrix.getFrameMin()), rectX + 5, rectY + 15); |
|
|
|
// |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// g2d.dispose(); |
|
|
|
// // 保存标注后的图片 |
|
|
|
// File outputFile = new File(outputPath); |
|
|
|
// // 确保输出目录存在 |
|
|
|
// outputFile.getParentFile().mkdirs(); |
|
|
|
// |
|
|
|
// ImageIO.write(annotatedImage, "jpg", outputFile); |
|
|
|
//// System.out.println("标注后的图片已保存到: " + outputPath); |
|
|
|
// |
|
|
|
// } catch (IOException e) { |
|
|
|
// System.err.println("处理图片时出错: " + e.getMessage()); |
|
|
|
// e.printStackTrace(); |
|
|
|
// } |
|
|
|
// return outputPath; |
|
|
|
// } |
|
|
|
|
|
|
|
//图片标注_iVS1800 |
|
|
|
public String ImageOverlaysIvs(Coordinate coordinate, InfraredInfo infraredInfo) { |
|
|
|
|
|
|
|
Coordinate[] coordinates = coordinate.getCoordinates(); |
|
|
|
|
|
|
|
Date date = new Date(); |
|
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); |
|
|
|
String markPicName = sf.format(date); |
|
|
|
// 图片路径(请替换为实际路径) |
|
|
|
String imagePath = coordinate.getFilePath(); |
|
|
|
// 获取文件名(不含扩展名) |
|
|
|
File file = new File(imagePath); |
|
|
|
String fileName = file.getName(); |
|
|
|
String pureName = fileName.substring(0, fileName.lastIndexOf('.')); |
|
|
|
String filename = picPath; |
|
|
|
String outputPath = picPath + pureName + "_" + markPicName + ".jpg"; |
|
|
|
//判断路径是否存在 |
|
|
|
File filePath = new File(filename); |
|
|
|
if (!filePath.exists()) { |
|
|
|
//不存在,创建目录 |
|
|
|
filePath.mkdirs(); |
|
|
|
} |
|
|
|
try { |
|
|
|
// 加载原始图片 |
|
|
|
BufferedImage originalImage = ImageIO.read(new File(imagePath)); |
|
|
|
if (originalImage == null) { |
|
|
|
System.err.println("无法加载图片: " + imagePath); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
// 创建可编辑的图片副本 |
|
|
|
BufferedImage annotatedImage = new BufferedImage( |
|
|
|
originalImage.getWidth(), |
|
|
|
originalImage.getHeight(), |
|
|
|
BufferedImage.TYPE_INT_RGB |
|
|
|
); |
|
|
|
// 绘制原始图片 |
|
|
|
Graphics2D g2d = annotatedImage.createGraphics(); |
|
|
|
g2d.drawImage(originalImage, 0, 0, null); |
|
|
|
|
|
|
|
// 设置标注样式 |
|
|
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
|
|
|
Font font = new Font("微软雅黑", Font.BOLD, 17); |
|
|
|
|
|
|
|
for (Coordinate c : coordinates) { |
|
|
|
g2d.setFont(font); |
|
|
|
//矩阵标注 |
|
|
|
if (c.getSecondX() != null && c.getSecondY() != null) { |
|
|
|
// 标注矩形(每两个点确定一个矩形) |
|
|
|
g2d.setColor(Color.WHITE); |
|
|
|
int x1 = c.getFirstX(); |
|
|
|
int y1 = c.getFirstY(); |
|
|
|
int x2 = c.getSecondX(); |
|
|
|
int y2 = c.getSecondY(); |
|
|
|
|
|
|
|
// 确保坐标在图片范围内 |
|
|
|
if (x1 >= 0 && x1 < originalImage.getWidth() && y1 >= 0 && y1 < originalImage.getHeight() && |
|
|
|
x2 >= 0 && x2 < originalImage.getWidth() && y2 >= 0 && y2 < originalImage.getHeight()) { |
|
|
|
|
|
|
|
// 确保x1,y1是左上角,x2,y2是右下角 |
|
|
|
int rectX = Math.min(x1, x2); |
|
|
|
int rectY = Math.min(y1, y2); |
|
|
|
int width = Math.abs(x2 - x1); |
|
|
|
int height = Math.abs(y2 - y1); |
|
|
|
// 绘制矩形 |
|
|
|
g2d.drawRect(rectX, rectY, width, height); |
|
|
|
|
|
|
|
coordinate.setFirstX(x1); |
|
|
|
coordinate.setFirstY(y1); |
|
|
|
coordinate.setSecondX(x2); |
|
|
|
coordinate.setSecondY(y2); |
|
|
|
// 添加矩形标签 |
|
|
|
//图片路径取值 |
|
|
|
String[] dividePath = Paths.get(imagePath).getFileName().toString().replaceAll("(?i)\\.jpg$", "").split("_"); |
|
|
|
String max = dividePath[dividePath.length - 3]; // 最大值 |
|
|
|
String min = dividePath[dividePath.length - 2]; // 最小值 |
|
|
|
String avg = dividePath[dividePath.length - 1]; // 平均值 |
|
|
|
infraredInfo.setFrameMax(Float.parseFloat(max)); |
|
|
|
// g2d.drawString("平均温度:" +avg + "最高温度:" + max + "最低温度:" + min, rectX + 5, rectY + 15); |
|
|
|
|
|
|
|
String line1 = "平均温度:" + avg; |
|
|
|
String line2 = "最高温度:" + max; |
|
|
|
String line3 = "最低温度:" + min; |
|
|
|
|
|
|
|
g2d.drawString(line1, rectX + 5, rectY + 15); |
|
|
|
g2d.drawString(line2, rectX + 5, rectY + 30); |
|
|
|
g2d.drawString(line3, rectX + 5, rectY + 45); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
g2d.dispose(); |
|
|
|
// 保存标注后的图片 |
|
|
|
File outputFile = new File(outputPath); |
|
|
|
// 确保输出目录存在 |
|
|
|
outputFile.getParentFile().mkdirs(); |
|
|
|
ImageIO.write(annotatedImage, "jpg", outputFile); |
|
|
|
} catch (IOException e) { |
|
|
|
System.err.println("处理图片时出错: " + e.getMessage()); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
return outputPath; |
|
|
|
} |
|
|
|
// public String ImageOverlaysIvs(Coordinate coordinate, InfraredInfo infraredInfo) { |
|
|
|
// |
|
|
|
// Coordinate[] coordinates = coordinate.getCoordinates(); |
|
|
|
// |
|
|
|
// Date date = new Date(); |
|
|
|
// SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); |
|
|
|
// String markPicName = sf.format(date); |
|
|
|
// // 图片路径(请替换为实际路径) |
|
|
|
// String imagePath = coordinate.getFilePath(); |
|
|
|
// // 获取文件名(不含扩展名) |
|
|
|
// File file = new File(imagePath); |
|
|
|
// String fileName = file.getName(); |
|
|
|
// String pureName = fileName.substring(0, fileName.lastIndexOf('.')); |
|
|
|
// String filename = picPath; |
|
|
|
// String outputPath = picPath + pureName + "_" + markPicName + ".jpg"; |
|
|
|
// //判断路径是否存在 |
|
|
|
// File filePath = new File(filename); |
|
|
|
// if (!filePath.exists()) { |
|
|
|
// //不存在,创建目录 |
|
|
|
// filePath.mkdirs(); |
|
|
|
// } |
|
|
|
// try { |
|
|
|
// // 加载原始图片 |
|
|
|
// BufferedImage originalImage = ImageIO.read(new File(imagePath)); |
|
|
|
// if (originalImage == null) { |
|
|
|
// System.err.println("无法加载图片: " + imagePath); |
|
|
|
// return null; |
|
|
|
// } |
|
|
|
// |
|
|
|
// // 创建可编辑的图片副本 |
|
|
|
// BufferedImage annotatedImage = new BufferedImage( |
|
|
|
// originalImage.getWidth(), |
|
|
|
// originalImage.getHeight(), |
|
|
|
// BufferedImage.TYPE_INT_RGB |
|
|
|
// ); |
|
|
|
// // 绘制原始图片 |
|
|
|
// Graphics2D g2d = annotatedImage.createGraphics(); |
|
|
|
// g2d.drawImage(originalImage, 0, 0, null); |
|
|
|
// |
|
|
|
// // 设置标注样式 |
|
|
|
// g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
|
|
|
// Font font = new Font("微软雅黑", Font.BOLD, 17); |
|
|
|
// |
|
|
|
// for (Coordinate c : coordinates) { |
|
|
|
// g2d.setFont(font); |
|
|
|
// //矩阵标注 |
|
|
|
// if (c.getSecondX() != null && c.getSecondY() != null) { |
|
|
|
// // 标注矩形(每两个点确定一个矩形) |
|
|
|
// g2d.setColor(Color.WHITE); |
|
|
|
// int x1 = c.getFirstX(); |
|
|
|
// int y1 = c.getFirstY(); |
|
|
|
// int x2 = c.getSecondX(); |
|
|
|
// int y2 = c.getSecondY(); |
|
|
|
// |
|
|
|
// // 确保坐标在图片范围内 |
|
|
|
// if (x1 >= 0 && x1 < originalImage.getWidth() && y1 >= 0 && y1 < originalImage.getHeight() && |
|
|
|
// x2 >= 0 && x2 < originalImage.getWidth() && y2 >= 0 && y2 < originalImage.getHeight()) { |
|
|
|
// |
|
|
|
// // 确保x1,y1是左上角,x2,y2是右下角 |
|
|
|
// int rectX = Math.min(x1, x2); |
|
|
|
// int rectY = Math.min(y1, y2); |
|
|
|
// int width = Math.abs(x2 - x1); |
|
|
|
// int height = Math.abs(y2 - y1); |
|
|
|
// // 绘制矩形 |
|
|
|
// g2d.drawRect(rectX, rectY, width, height); |
|
|
|
// |
|
|
|
// coordinate.setFirstX(x1); |
|
|
|
// coordinate.setFirstY(y1); |
|
|
|
// coordinate.setSecondX(x2); |
|
|
|
// coordinate.setSecondY(y2); |
|
|
|
// // 添加矩形标签 |
|
|
|
// //图片路径取值 |
|
|
|
// String[] dividePath = Paths.get(imagePath).getFileName().toString().replaceAll("(?i)\\.jpg$", "").split("_"); |
|
|
|
// String max = dividePath[dividePath.length - 3]; // 最大值 |
|
|
|
// String min = dividePath[dividePath.length - 2]; // 最小值 |
|
|
|
// String avg = dividePath[dividePath.length - 1]; // 平均值 |
|
|
|
// infraredInfo.setFrameMax(Float.parseFloat(max)); |
|
|
|
//// g2d.drawString("平均温度:" +avg + "最高温度:" + max + "最低温度:" + min, rectX + 5, rectY + 15); |
|
|
|
// |
|
|
|
// String line1 = "平均温度:" + avg; |
|
|
|
// String line2 = "最高温度:" + max; |
|
|
|
// String line3 = "最低温度:" + min; |
|
|
|
// |
|
|
|
// g2d.drawString(line1, rectX + 5, rectY + 15); |
|
|
|
// g2d.drawString(line2, rectX + 5, rectY + 30); |
|
|
|
// g2d.drawString(line3, rectX + 5, rectY + 45); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// g2d.dispose(); |
|
|
|
// // 保存标注后的图片 |
|
|
|
// File outputFile = new File(outputPath); |
|
|
|
// // 确保输出目录存在 |
|
|
|
// outputFile.getParentFile().mkdirs(); |
|
|
|
// ImageIO.write(annotatedImage, "jpg", outputFile); |
|
|
|
// } catch (IOException e) { |
|
|
|
// System.err.println("处理图片时出错: " + e.getMessage()); |
|
|
|
// e.printStackTrace(); |
|
|
|
// } |
|
|
|
// return outputPath; |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
//图片标注__无人机 |
|
|
|
public String ImageOverlaysUav(Coordinate coordinate, InfraredInfo infraredInfo) { |
|
|
|
public String ImageOverlaysUav(InfraPictureInfo infraPictureInfo, InfraredInfo infraredInfo) { |
|
|
|
|
|
|
|
Coordinate[] coordinates = coordinate.getCoordinates(); |
|
|
|
List<Coordinate> coordinates = infraPictureInfo.getCoordinates(); |
|
|
|
|
|
|
|
Date date = new Date(); |
|
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); |
|
|
|
String markPicName = sf.format(date); |
|
|
|
// 图片路径(请替换为实际路径) |
|
|
|
String imagePath = coordinate.getFilePath(); |
|
|
|
String imagePath = infraPictureInfo.getFilePath(); |
|
|
|
// 获取文件名(不含扩展名) |
|
|
|
File file = new File(imagePath); |
|
|
|
String fileName = file.getName(); |
|
|
|
@ -854,7 +841,7 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
} |
|
|
|
try { |
|
|
|
InputStream inputStreamPath = downloadFtp(imagePath); |
|
|
|
if (inputStreamPath==null){ |
|
|
|
if (inputStreamPath == null) { |
|
|
|
System.out.println("无法加载图片: " + imagePath); |
|
|
|
} |
|
|
|
// 加载原始图片 |
|
|
|
@ -894,11 +881,11 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
y >= 0 && y < originalImage.getHeight()) { |
|
|
|
// 绘制点(用实心圆表示) |
|
|
|
g2d.fillOval(x - 3, y - 3, 6, 6); |
|
|
|
coordinate.setFirstX(x); |
|
|
|
coordinate.setFirstY(y); |
|
|
|
InfraredInfo drawStringPoint = PointTemperatureShow(coordinate, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); |
|
|
|
// 添加坐标标签 |
|
|
|
g2d.drawString("(" + String.format("%.2f", drawStringPoint.getPointTemperature()) + ")", x + 8, y - 8); |
|
|
|
infraPictureInfo.setFirstX(x); |
|
|
|
infraPictureInfo.setFirstY(y); |
|
|
|
// InfraredInfo drawStringPoint = PointTemperatureShow(c, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); |
|
|
|
// // 添加坐标标签 |
|
|
|
// g2d.drawString("(" + String.format("%.2f", drawStringPoint.getPointTemperature()) + ")", x + 8, y - 8); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -922,12 +909,12 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
int height = Math.abs(y2 - y1); |
|
|
|
// 绘制矩形 |
|
|
|
g2d.drawRect(rectX, rectY, width, height); |
|
|
|
coordinate.setFirstX(x1); |
|
|
|
coordinate.setFirstY(y1); |
|
|
|
coordinate.setSecondX(x2); |
|
|
|
coordinate.setSecondY(y2); |
|
|
|
infraPictureInfo.setFirstX(x1); |
|
|
|
infraPictureInfo.setFirstY(y1); |
|
|
|
infraPictureInfo.setSecondX(x2); |
|
|
|
infraPictureInfo.setSecondY(y2); |
|
|
|
|
|
|
|
InfraredInfo drawStringMatrix = matrixTemperatureShow(coordinate, infraredInfo.getMatrixWidth(), infraredInfo.getMatrixHeight(), infraredInfo.getTemperatureMatrix()); |
|
|
|
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()); |
|
|
|
@ -946,7 +933,7 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
ImageIO.write(annotatedImage, "jpg", os); |
|
|
|
InputStream inputStream = new ByteArrayInputStream(os.toByteArray()); |
|
|
|
|
|
|
|
picFtp(outputPath, inputStream,ftpUrlAddress,ftpUrlPort,ftpUrlAccount,ftpUrlPwd); |
|
|
|
picFtp(outputPath, inputStream, ftpUrlAddress, ftpUrlPort, ftpUrlAccount, ftpUrlPwd); |
|
|
|
|
|
|
|
// // 保存标注后的图片 |
|
|
|
// File outputFile = new File(outputPath); |
|
|
|
@ -1098,7 +1085,7 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void picFtp(String newPath, InputStream originalPath,String ftpUrlAddress,Integer ftpUrlPort,String ftpUrlAccount,String ftpUrlPwd) { |
|
|
|
public void picFtp(String newPath, InputStream originalPath, String ftpUrlAddress, Integer ftpUrlPort, String ftpUrlAccount, String ftpUrlPwd) { |
|
|
|
FTPSClient ftps = null; |
|
|
|
try { |
|
|
|
ftps = new FTPSClient(true); |
|
|
|
@ -1130,7 +1117,7 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void pic2Ftp(String newPath, InputStream originalPath,String ftpUrlAddress,Integer ftpUrlPort,String ftpUrlAccount,String ftpUrlPwd) { |
|
|
|
public void pic2Ftp(String newPath, InputStream originalPath, String ftpUrlAddress, Integer ftpUrlPort, String ftpUrlAccount, String ftpUrlPwd) { |
|
|
|
FTPClient ftps = null; |
|
|
|
try { |
|
|
|
ftps = new FTPClient(); |
|
|
|
@ -1186,14 +1173,12 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public AjaxResult calculatePicture(Coordinate coordinate) { |
|
|
|
public AjaxResult calculatePicture(InfraPictureInfo infraPictureInfo) { |
|
|
|
|
|
|
|
InfraredInfo infraredInfo = new InfraredInfo(); |
|
|
|
try { |
|
|
|
String imagePath = coordinate.getFilePath(); |
|
|
|
String imagePath = infraPictureInfo.getFilePath(); |
|
|
|
// String imagePath = "/images/ir_test.jpg"; |
|
|
|
InputStream inputStream = downloadFtp(imagePath); |
|
|
|
String protocol = hrFtpUrl.substring(0, 6); // "ftp://" |
|
|
|
@ -1209,20 +1194,20 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
String[] hostAndPort = hostPort.split(":"); |
|
|
|
String host = hostAndPort[0]; |
|
|
|
int port = Integer.parseInt(hostAndPort[1]); |
|
|
|
picFtp("/",inputStream,host,port,username,password); |
|
|
|
picFtp("/", inputStream, host, port, username, password); |
|
|
|
|
|
|
|
String imageName = Paths.get(imagePath).getFileName().toString(); |
|
|
|
String ftpUrlName = "[\"" + hrFtpUrl + imageName + "\"]"; |
|
|
|
|
|
|
|
|
|
|
|
if (coordinate.getImgType() == 1) { |
|
|
|
if (infraPictureInfo.getImgType() == 1) { |
|
|
|
byte[] imageBytes = Files.readAllBytes(Paths.get(imagePath)); |
|
|
|
infraredInfo = readDataHw(imageBytes, coordinate); |
|
|
|
} else if (coordinate.getImgType() == 2) { |
|
|
|
infraredInfo = readDataHw(imageBytes, infraPictureInfo.getCoordinates().get(0)); |
|
|
|
} else if (infraPictureInfo.getImgType() == 2) { |
|
|
|
|
|
|
|
String s = ImageOverlaysIvs(coordinate, infraredInfo); |
|
|
|
infraredInfo.setOutPath(s); |
|
|
|
} else if (coordinate.getImgType() == 3) { |
|
|
|
// String s = ImageOverlaysIvs(infraPictureInfo.getCoordinates().get(0), infraredInfo); |
|
|
|
// infraredInfo.setOutPath(s); |
|
|
|
} else if (infraPictureInfo.getImgType() == 3) { |
|
|
|
//sdk版本调用x86_32 |
|
|
|
//float[][] imageTem = djService.getImageTem(coordinate.getFilePath()); |
|
|
|
|
|
|
|
@ -1230,7 +1215,7 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
float[][] imageTem = UploadFtpImage(hrUavUrl, null, ftpUrlName); |
|
|
|
if (imageTem != null && imageTem.length > 0 && imageTem[0].length > 0) { |
|
|
|
infraredInfo.setTemperatureMatrix(imageTem); |
|
|
|
String s = ImageOverlaysUav(coordinate, infraredInfo); |
|
|
|
String s = ImageOverlaysUav(infraPictureInfo, infraredInfo); |
|
|
|
infraredInfo.setOutPath(s); |
|
|
|
} else { |
|
|
|
return AjaxResult.error("温度解析错误!"); |
|
|
|
|