|
|
|
|
@ -932,6 +932,60 @@ struct Function_Image_Align
|
|
|
|
|
return str123;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
// 支架检测
|
|
|
|
|
struct Function_Support_Det
|
|
|
|
|
{
|
|
|
|
|
bool bOpen; // 是否开启
|
|
|
|
|
std::vector<cv::Point> supportRegion;
|
|
|
|
|
cv::RotatedRect supportRect;
|
|
|
|
|
float x_offset;
|
|
|
|
|
float y_offset;
|
|
|
|
|
float r_offset;
|
|
|
|
|
std::vector<cv::Point> handleRegion;
|
|
|
|
|
cv::RotatedRect handleRect;
|
|
|
|
|
|
|
|
|
|
Function_Support_Det ()
|
|
|
|
|
{
|
|
|
|
|
Init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Init()
|
|
|
|
|
{
|
|
|
|
|
bOpen = false;
|
|
|
|
|
supportRegion.clear();
|
|
|
|
|
supportRect = cv::RotatedRect();
|
|
|
|
|
x_offset = 0;
|
|
|
|
|
y_offset = 0;
|
|
|
|
|
r_offset = 0;
|
|
|
|
|
handleRegion.clear();
|
|
|
|
|
handleRect = cv::RotatedRect();
|
|
|
|
|
}
|
|
|
|
|
void copy(Function_Support_Det tem)
|
|
|
|
|
{
|
|
|
|
|
this->bOpen = tem.bOpen;
|
|
|
|
|
this->supportRegion.assign(tem.supportRegion.begin(), tem.supportRegion.end());
|
|
|
|
|
this->supportRect = tem.supportRect;
|
|
|
|
|
this->x_offset = tem.x_offset;
|
|
|
|
|
this->y_offset = tem.y_offset;
|
|
|
|
|
this->r_offset = tem.r_offset;
|
|
|
|
|
this->handleRegion.assign(tem.handleRegion.begin(), tem.handleRegion.end());
|
|
|
|
|
this->handleRect = tem.handleRect;
|
|
|
|
|
}
|
|
|
|
|
void print(std::string str)
|
|
|
|
|
{
|
|
|
|
|
printf("%s>>bOpen %d x_offset %f y_offset %f r_offset %f\n", str.c_str(),
|
|
|
|
|
bOpen, x_offset, y_offset, r_offset);
|
|
|
|
|
}
|
|
|
|
|
std::string GetInfo(std::string str)
|
|
|
|
|
{
|
|
|
|
|
char buffer[256];
|
|
|
|
|
sprintf(buffer, "%s>>bOpen %d x_offset %f y_offset %f r_offset %f\n", str.c_str(),
|
|
|
|
|
bOpen, x_offset, y_offset, r_offset);
|
|
|
|
|
std::string str123 = buffer;
|
|
|
|
|
return str123;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 检测功能
|
|
|
|
|
struct CheckFunction
|
|
|
|
|
@ -942,6 +996,7 @@ struct CheckFunction
|
|
|
|
|
Function_ShieldRegion f_ShieldRegion;
|
|
|
|
|
Function_EdgeROI f_EdgeROI;
|
|
|
|
|
Function_Image_Align f_Image_Align; // 图片特征对齐
|
|
|
|
|
Function_Support_Det f_supportDet;
|
|
|
|
|
CheckFunction()
|
|
|
|
|
{
|
|
|
|
|
Init();
|
|
|
|
|
@ -954,6 +1009,7 @@ struct CheckFunction
|
|
|
|
|
f_ShieldRegion.Init();
|
|
|
|
|
f_EdgeROI.Init();
|
|
|
|
|
f_Image_Align.Init();
|
|
|
|
|
f_supportDet.Init();
|
|
|
|
|
}
|
|
|
|
|
void copy(CheckFunction tem)
|
|
|
|
|
{
|
|
|
|
|
@ -964,6 +1020,7 @@ struct CheckFunction
|
|
|
|
|
this->f_ShieldRegion.copy(tem.f_ShieldRegion);
|
|
|
|
|
this->f_EdgeROI.copy(tem.f_EdgeROI);
|
|
|
|
|
this->f_Image_Align.copy(tem.f_Image_Align);
|
|
|
|
|
this->f_supportDet.copy(tem.f_supportDet);
|
|
|
|
|
}
|
|
|
|
|
void print(std::string str)
|
|
|
|
|
{
|
|
|
|
|
@ -974,6 +1031,7 @@ struct CheckFunction
|
|
|
|
|
f_ShieldRegion.print("ShieldRegion");
|
|
|
|
|
f_EdgeROI.print("EdgeROI");
|
|
|
|
|
f_Image_Align.print("Image_Align");
|
|
|
|
|
f_supportDet.print("supportDet");
|
|
|
|
|
}
|
|
|
|
|
std::string GetInfo(std::string str)
|
|
|
|
|
{
|
|
|
|
|
@ -985,9 +1043,11 @@ struct CheckFunction
|
|
|
|
|
str123 += f_ShieldRegion.GetInfo("ShieldRegion");
|
|
|
|
|
str123 += f_EdgeROI.GetInfo("EdgeROI");
|
|
|
|
|
str123 += f_Image_Align.GetInfo("Image_Align");
|
|
|
|
|
str123 += f_supportDet.GetInfo("supportDet");
|
|
|
|
|
return str123;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 单通道检测功能
|
|
|
|
|
struct ChannelCheckFunction
|
|
|
|
|
{
|
|
|
|
|
@ -1302,60 +1362,6 @@ struct Base_Function_Edge_Det
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 支架检测
|
|
|
|
|
struct Base_Function_Support_Det
|
|
|
|
|
{
|
|
|
|
|
bool bOpen; // 是否开启
|
|
|
|
|
std::vector<cv::Point> supportRegion;
|
|
|
|
|
cv::RotatedRect supportRect;
|
|
|
|
|
float x_offset;
|
|
|
|
|
float y_offset;
|
|
|
|
|
float r_offset;
|
|
|
|
|
std::vector<cv::Point> handleRegion;
|
|
|
|
|
cv::RotatedRect handleRect;
|
|
|
|
|
|
|
|
|
|
Base_Function_Support_Det()
|
|
|
|
|
{
|
|
|
|
|
Init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Init()
|
|
|
|
|
{
|
|
|
|
|
bOpen = false;
|
|
|
|
|
supportRegion.clear();
|
|
|
|
|
supportRect = cv::RotatedRect();
|
|
|
|
|
x_offset = 0;
|
|
|
|
|
y_offset = 0;
|
|
|
|
|
r_offset = 0;
|
|
|
|
|
handleRegion.clear();
|
|
|
|
|
handleRect = cv::RotatedRect();
|
|
|
|
|
}
|
|
|
|
|
void copy(Base_Function_Support_Det tem)
|
|
|
|
|
{
|
|
|
|
|
this->bOpen = tem.bOpen;
|
|
|
|
|
this->supportRegion.assign(tem.supportRegion.begin(), tem.supportRegion.end());
|
|
|
|
|
this->supportRect = tem.supportRect;
|
|
|
|
|
this->x_offset = tem.x_offset;
|
|
|
|
|
this->y_offset = tem.y_offset;
|
|
|
|
|
this->r_offset = tem.r_offset;
|
|
|
|
|
this->handleRegion.assign(tem.handleRegion.begin(), tem.handleRegion.end());
|
|
|
|
|
this->handleRect = tem.handleRect;
|
|
|
|
|
}
|
|
|
|
|
void print(std::string str)
|
|
|
|
|
{
|
|
|
|
|
printf("%s>>bOpen %d x_offset %f y_offset %f r_offset %f\n", str.c_str(),
|
|
|
|
|
bOpen, x_offset, y_offset, r_offset);
|
|
|
|
|
}
|
|
|
|
|
std::string GetInfo(std::string str)
|
|
|
|
|
{
|
|
|
|
|
char buffer[256];
|
|
|
|
|
sprintf(buffer, "%s>>bOpen %d x_offset %f y_offset %f r_offset %f\n", str.c_str(),
|
|
|
|
|
bOpen, x_offset, y_offset, r_offset);
|
|
|
|
|
std::string str123 = buffer;
|
|
|
|
|
return str123;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
// 基础检测功能
|
|
|
|
|
struct BaseCheckFunction
|
|
|
|
|
{
|
|
|
|
|
@ -1363,7 +1369,6 @@ struct BaseCheckFunction
|
|
|
|
|
Base_Function_Edge_Det edgeDet;
|
|
|
|
|
Base_Function_SaveImg saveImg;
|
|
|
|
|
Base_Function_BigNG bigNG;
|
|
|
|
|
Base_Function_Support_Det supportDet;
|
|
|
|
|
|
|
|
|
|
BaseCheckFunction()
|
|
|
|
|
{
|
|
|
|
|
@ -1375,7 +1380,6 @@ struct BaseCheckFunction
|
|
|
|
|
edgeDet.Init();
|
|
|
|
|
saveImg.Init();
|
|
|
|
|
bigNG.Init();
|
|
|
|
|
supportDet.Init();
|
|
|
|
|
}
|
|
|
|
|
void copy(BaseCheckFunction tem)
|
|
|
|
|
{
|
|
|
|
|
@ -1383,7 +1387,6 @@ struct BaseCheckFunction
|
|
|
|
|
this->edgeDet.copy(tem.edgeDet);
|
|
|
|
|
this->saveImg.copy(tem.saveImg);
|
|
|
|
|
this->bigNG.copy(tem.bigNG);
|
|
|
|
|
this->supportDet.copy(tem.supportDet);
|
|
|
|
|
}
|
|
|
|
|
void print(std::string str)
|
|
|
|
|
{
|
|
|
|
|
@ -1392,7 +1395,6 @@ struct BaseCheckFunction
|
|
|
|
|
edgeDet.print("edgeDet");
|
|
|
|
|
saveImg.print("saveImg");
|
|
|
|
|
bigNG.print("bigNG");
|
|
|
|
|
supportDet.print("supportDet");
|
|
|
|
|
}
|
|
|
|
|
std::string GetInfo(std::string str)
|
|
|
|
|
{
|
|
|
|
|
@ -1401,7 +1403,6 @@ struct BaseCheckFunction
|
|
|
|
|
str123 += edgeDet.GetInfo("edgeDet");
|
|
|
|
|
str123 += saveImg.GetInfo("saveImg");
|
|
|
|
|
str123 += bigNG.GetInfo("bigNG");
|
|
|
|
|
str123 += supportDet.GetInfo("supportDet");
|
|
|
|
|
// str123 += "\n";
|
|
|
|
|
return str123;
|
|
|
|
|
}
|
|
|
|
|
|