|
|
|
@ -37,13 +37,10 @@ import javax.imageio.ImageIO; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
import java.io.*; |
|
|
|
import java.net.HttpURLConnection; |
|
|
|
import java.net.URL; |
|
|
|
import java.nio.ByteBuffer; |
|
|
|
import java.nio.ByteOrder; |
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
import java.nio.file.Files; |
|
|
|
import java.nio.file.Path; |
|
|
|
import java.nio.file.Paths; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
@ -81,9 +78,9 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 设备登录V40 与V30功能一致 |
|
|
|
*/ |
|
|
|
// /** |
|
|
|
// * 设备登录V40 与V30功能一致 |
|
|
|
// */ |
|
|
|
// public AjaxResult login_V40(NvrInfo nvrInfo) { |
|
|
|
// |
|
|
|
// HCNetSDK.NET_DVR_USER_LOGIN_INFO m_strLoginInfo = HikVisionUtils.login_V40(nvrInfo.getNvrIp(), nvrInfo.getServerPort().shortValue(), nvrInfo.getAccount(), nvrInfo.getPassword());//设备登录信息 |
|
|
|
@ -300,7 +297,7 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
String s = ImageOverlaysIvs(coordinate, infraredInfo); |
|
|
|
infraredInfo.setOutPath(s); |
|
|
|
} else if (coordinate.getImgType() == 3) { |
|
|
|
//sdk版本调用 |
|
|
|
//sdk版本调用x86_32 |
|
|
|
//float[][] imageTem = djService.getImageTem(coordinate.getFilePath()); |
|
|
|
|
|
|
|
//调用华软接口 |
|
|
|
@ -593,8 +590,14 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
File file = new File(imagePath); |
|
|
|
String fileName = file.getName(); |
|
|
|
String pureName = fileName.substring(0, fileName.lastIndexOf('.')); |
|
|
|
// String imagePath = picPath+"/pic/hw/20250409141218PLAY_CELLPHONE_.jpg"; |
|
|
|
String outputPath = picPath + "/pic/hw/mark/" + pureName + "_" + markPicName + ".jpg"; |
|
|
|
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)); |
|
|
|
@ -706,8 +709,14 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
File file = new File(imagePath); |
|
|
|
String fileName = file.getName(); |
|
|
|
String pureName = fileName.substring(0, fileName.lastIndexOf('.')); |
|
|
|
// String imagePath = picPath+"/pic/hw/20250409141218PLAY_CELLPHONE_.jpg"; |
|
|
|
String outputPath = picPath + "/pic/hw/mark/" + pureName + "_" + markPicName + ".jpg"; |
|
|
|
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)); |
|
|
|
@ -804,7 +813,14 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
File file = new File(imagePath); |
|
|
|
String fileName = file.getName(); |
|
|
|
String pureName = fileName.substring(0, fileName.lastIndexOf('.')); |
|
|
|
String outputPath = picPath + "/pic/hw/mark/" + pureName + "_" + markPicName + ".jpg"; |
|
|
|
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)); |
|
|
|
@ -951,8 +967,21 @@ public class HikVisionServiceImpl implements HikVisionService { |
|
|
|
|
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
System.err.println("请求处理失败: " + e.getMessage()); |
|
|
|
e.printStackTrace(); |
|
|
|
System.err.println("FTP请求处理失败,尝试本地文件: " + e.getMessage()); |
|
|
|
|
|
|
|
// Fall back to local file |
|
|
|
try { |
|
|
|
String localPath = picPath+"1.csv"; |
|
|
|
// String csvFileName = image.replaceAll("\\..+$", ".csv"); |
|
|
|
File csvFile = new File(localPath); |
|
|
|
if (!csvFile.exists()) { |
|
|
|
throw new FileNotFoundException("本地CSV文件不存在: " + csvFile.getAbsolutePath()); |
|
|
|
} |
|
|
|
floats = parseCsvFromFtp(csvFile.toString()); |
|
|
|
} catch (Exception localException) { |
|
|
|
System.err.println("本地文件处理失败: " + localException.getMessage()); |
|
|
|
localException.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
return floats; |
|
|
|
} |
|
|
|
|