|
|
|
@ -1038,7 +1038,7 @@ int deal::GetImgInfo_POL_ET_PNG(std::string strImgPath, JC_IMAGE_INFO_ *pImageIn
|
|
|
|
// -f 批量跑新格式: 解析图片名组装产品信息
|
|
|
|
// -f 批量跑新格式: 解析图片名组装产品信息
|
|
|
|
// 图片名示例: 1M10121554R2B3_buckle_down2_src.jpg
|
|
|
|
// 图片名示例: 1M10121554R2B3_buckle_down2_src.jpg
|
|
|
|
// 产品ID: 第一个 '_' 之前的部分 (1M10121554R2B3)
|
|
|
|
// 产品ID: 第一个 '_' 之前的部分 (1M10121554R2B3)
|
|
|
|
// 相机名/通道名: 直接匹配文件名中的相机名(如 buckle), 只处理后缀为 _src 的原图
|
|
|
|
// 相机名/通道名: 只处理文件名包含 buckle 且后缀为 _src 的原图
|
|
|
|
int deal::GetImgInfo_SOCKET_SRC(std::string strImgPath, JC_IMAGE_INFO_ *pImageInfo)
|
|
|
|
int deal::GetImgInfo_SOCKET_SRC(std::string strImgPath, JC_IMAGE_INFO_ *pImageInfo)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (pImageInfo == NULL)
|
|
|
|
if (pImageInfo == NULL)
|
|
|
|
@ -1048,6 +1048,13 @@ int deal::GetImgInfo_SOCKET_SRC(std::string strImgPath, JC_IMAGE_INFO_ *pImageIn
|
|
|
|
|
|
|
|
|
|
|
|
std::string strName = ExtractFileNameWithoutExtension(strImgPath);
|
|
|
|
std::string strName = ExtractFileNameWithoutExtension(strImgPath);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 只处理文件名包含 buckle 的图片, 跳过 t_face_bright/t_face_dark 等其它相机
|
|
|
|
|
|
|
|
if (strName.find("buckle") == std::string::npos)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("GetImgInfo_SOCKET_SRC: no buckle in name, skip %s\n", strImgPath.c_str());
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 只处理后缀为 _src 的原图, 跳过 _roi 等其它图
|
|
|
|
// 只处理后缀为 _src 的原图, 跳过 _roi 等其它图
|
|
|
|
const std::string strSrcSuffix = "_src";
|
|
|
|
const std::string strSrcSuffix = "_src";
|
|
|
|
if (strName.size() <= strSrcSuffix.size() ||
|
|
|
|
if (strName.size() <= strSrcSuffix.size() ||
|
|
|
|
@ -1056,25 +1063,8 @@ int deal::GetImgInfo_SOCKET_SRC(std::string strImgPath, JC_IMAGE_INFO_ *pImageIn
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 直接匹配文件名中的相机名, 相机名同时作为通道名
|
|
|
|
// 相机名同时作为通道名
|
|
|
|
std::string strCamName = "";
|
|
|
|
std::string strCamName = "buckle";
|
|
|
|
if (strName.find("buckle") != std::string::npos)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
strCamName = "buckle";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (strName.find("t_face_bright") != std::string::npos)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
strCamName = "t_face_bright";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (strName.find("t_face_dark") != std::string::npos)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
strCamName = "t_face_dark";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strCamName == "")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("GetImgInfo_SOCKET_SRC: no camera match, skip %s\n", strImgPath.c_str());
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 产品ID = 文件名第一个 '_' 之前的部分
|
|
|
|
// 产品ID = 文件名第一个 '_' 之前的部分
|
|
|
|
std::string strProductID = strName;
|
|
|
|
std::string strProductID = strName;
|
|
|
|
|