|
|
|
|
@ -18,7 +18,7 @@ int Extract_Name_Base::Read_Camera_Product_Image(std::string strPath, int userfl
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
std::vector<cv::String> img_paths;
|
|
|
|
|
// std::cout << strPath << std::endl;
|
|
|
|
|
std::cout << strPath << std::endl;
|
|
|
|
|
cv::glob(strPath, img_paths, true);
|
|
|
|
|
for (int i = 0; i < img_paths.size(); i++)
|
|
|
|
|
{
|
|
|
|
|
@ -142,7 +142,7 @@ int Read_Image::Read_Image_List(std::string strPath_left, std::string strPath_ri
|
|
|
|
|
|
|
|
|
|
int Extract_ALL::Extract_Info(std::string strPath, std::string strproduct, int userflag)
|
|
|
|
|
{
|
|
|
|
|
// std::cout << strPath << std::endl;
|
|
|
|
|
std::cout << strPath << std::endl;
|
|
|
|
|
// 1、获取 产品名称
|
|
|
|
|
std::string strProductName = Extract_Product_Name(strPath, userflag);
|
|
|
|
|
if (strProductName.empty())
|
|
|
|
|
@ -206,17 +206,15 @@ std::string Extract_ALL::Extract_Camera_Name(std::string strPath, int userflag)
|
|
|
|
|
|
|
|
|
|
fs::path p = fs::path(strPath);
|
|
|
|
|
std::string filename = p.stem();
|
|
|
|
|
|
|
|
|
|
// 文件名包含 CA 或 TA 即判定对应相机
|
|
|
|
|
// 支持旧格式: CA_20250508074237.ytimage
|
|
|
|
|
// 支持新格式: A_CAA.png, M_CAB.png (A_/M_ 仅是打光方式,同属一个camera)
|
|
|
|
|
if (filename.find("TA") != std::string::npos)
|
|
|
|
|
return "TA";
|
|
|
|
|
else if (filename.find("CA") != std::string::npos)
|
|
|
|
|
return "CA";
|
|
|
|
|
|
|
|
|
|
// std::cout << "完整路径: " << p << std::endl;
|
|
|
|
|
// std::cout << "文件名: " << p.filename() << std::endl;
|
|
|
|
|
// std::cout << "不带后缀的文件名: " << p.stem() << std::endl;
|
|
|
|
|
// std::cout << "后缀: " << p.extension() << std::endl;
|
|
|
|
|
// getchar();
|
|
|
|
|
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -248,6 +246,21 @@ std::string Extract_ALL::Extract_Channel_Name(std::string strPath, int userflag)
|
|
|
|
|
std::string strchannelName = "";
|
|
|
|
|
fs::path p = fs::path(strPath);
|
|
|
|
|
std::string filename = p.stem();
|
|
|
|
|
|
|
|
|
|
// 新格式: {Prefix}_{Type}{AB}, 如 A_CAA, M_TAB
|
|
|
|
|
// 通道名 = 前缀 (A/M), 表示不同打光方式
|
|
|
|
|
size_t underscorePos = filename.find('_');
|
|
|
|
|
if (underscorePos != std::string::npos)
|
|
|
|
|
{
|
|
|
|
|
std::string prefix = filename.substr(0, underscorePos);
|
|
|
|
|
std::string rest = filename.substr(underscorePos + 1);
|
|
|
|
|
if (rest == "CAA" || rest == "CAB" || rest == "TAA" || rest == "TAB")
|
|
|
|
|
{
|
|
|
|
|
return prefix; // "A" or "M"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 旧格式兼容: CA_xxx.ytimage, TA_xxx.ytimage
|
|
|
|
|
if (filename.find("TAA") != std::string::npos)
|
|
|
|
|
strchannelName = "TA";
|
|
|
|
|
else if (filename.find("TAB") != std::string::npos)
|
|
|
|
|
@ -264,20 +277,20 @@ std::string Extract_ALL::Extract_Channel_Name(std::string strPath, int userflag)
|
|
|
|
|
}
|
|
|
|
|
int Extract_ALL::Read_Image_List(std::string strPath, std::string strproduct)
|
|
|
|
|
{
|
|
|
|
|
std::string strSearchImgPath = strPath + "/*.ytimage";
|
|
|
|
|
std::string strSearchImgPath = strPath + "/*.png";
|
|
|
|
|
Read_Camera_Product_Image(strSearchImgPath, 0, strproduct);
|
|
|
|
|
|
|
|
|
|
// strSearchImgPath = strPath + "/*.png";
|
|
|
|
|
// Read_Camera_Product_Image(strSearchImgPath, 1);
|
|
|
|
|
strSearchImgPath = strPath + "/*.ytimage";
|
|
|
|
|
Read_Camera_Product_Image(strSearchImgPath, 0, strproduct);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int Extract_ALL::Read_Image_List(std::string strPath_left, std::string strPath_right, std::string strproduct)
|
|
|
|
|
{
|
|
|
|
|
std::string strSearchImgPath = strPath_left + "/*.ytimage";
|
|
|
|
|
std::string strSearchImgPath = strPath_left + "/*.png";
|
|
|
|
|
Read_Camera_Product_Image(strSearchImgPath, 0, strproduct);
|
|
|
|
|
strSearchImgPath = strPath_right + "/*.ytimage";
|
|
|
|
|
strSearchImgPath = strPath_right + "/*.png";
|
|
|
|
|
Read_Camera_Product_Image(strSearchImgPath, 0, strproduct);
|
|
|
|
|
|
|
|
|
|
// strSearchImgPath = strPath + "/*.png";
|
|
|
|
|
|