diff --git a/AlgorithmModule/src/ImgCheckAnalysisy.cpp b/AlgorithmModule/src/ImgCheckAnalysisy.cpp index ea32b7d..465feff 100644 --- a/AlgorithmModule/src/ImgCheckAnalysisy.cpp +++ b/AlgorithmModule/src/ImgCheckAnalysisy.cpp @@ -2548,8 +2548,8 @@ int ImgCheckAnalysisy::DrawResult_Step_1() } } - // 支架偏移检测绘制:支架中心十字(绿=正常/红=偏移NG)+ 支架到边缘的距离(绿=正常/红=超标准) - if (m_SupportDrawInfo.bValid && !m_CheckResult_shareP->resultimg.empty()) + // 支架偏移检测绘制(受参数 bDrawSupport 控制,默认关闭):支架中心十字(绿=正常/红=偏移NG)+ 支架到边缘的距离(绿=正常/红=超标准) + if (m_SupportDrawInfo.bValid && m_pbaseCheckFunction->supportDet.bDrawSupport && !m_CheckResult_shareP->resultimg.empty()) { // 支架中心:原图坐标 -> 检测图(裁剪) -> 结果图 cv::Point2f detPt = MatAffinePoint(m_matSrc2Det, m_SupportDrawInfo.ptCenter); diff --git a/ConfigModule/include/CheckConfigDefine.h b/ConfigModule/include/CheckConfigDefine.h index 3b6c547..06a74e9 100644 --- a/ConfigModule/include/CheckConfigDefine.h +++ b/ConfigModule/include/CheckConfigDefine.h @@ -923,6 +923,7 @@ struct Function_Support_Det { // 支架参数(Support_Detect) bool bDetSupport; // 支架偏位检测开关(Support_Detect.isOpen) + bool bDrawSupport; // 支架绘制开关(Support_Detect.form.support_param.bDrawSupport):是否绘制支架中心十字/距离线 float x_standard; // 水平方向标准距离(left/right 用) float y_standard; // 垂直方向标准距离(up/down 用) std::vector edge_select; // 参与计算的方向:up/down/left/right @@ -950,6 +951,7 @@ struct Function_Support_Det void Init() { bDetSupport = false; + bDrawSupport = false; x_standard = 0; y_standard = 0; edge_select.clear(); @@ -969,6 +971,7 @@ struct Function_Support_Det void copy(Function_Support_Det tem) { this->bDetSupport = tem.bDetSupport; + this->bDrawSupport = tem.bDrawSupport; this->x_standard = tem.x_standard; this->y_standard = tem.y_standard; this->edge_select.assign(tem.edge_select.begin(), tem.edge_select.end()); @@ -987,14 +990,14 @@ struct Function_Support_Det } void print(std::string str) { - printf("%s>>bDetSupport %d bDetHandle %d bDetTag %d x_standard %f y_standard %f x_offset %f y_offset %f r_offset %f edge num %ld handleRegion num %ld handle_diff %f BQ[area %f energy %f len %f hj %f]\n", - str.c_str(), bDetSupport, bDetHandle, bDetTag, x_standard, y_standard, x_offset, y_offset, r_offset, edge_select.size(), handleRegions.size(), handle_diff, BQ_area, BQ_energy, BQ_len, BQ_hj); + printf("%s>>bDetSupport %d bDrawSupport %d bDetHandle %d bDetTag %d x_standard %f y_standard %f x_offset %f y_offset %f r_offset %f edge num %ld handleRegion num %ld handle_diff %f BQ[area %f energy %f len %f hj %f]\n", + str.c_str(), bDetSupport, bDrawSupport, bDetHandle, bDetTag, x_standard, y_standard, x_offset, y_offset, r_offset, edge_select.size(), handleRegions.size(), handle_diff, BQ_area, BQ_energy, BQ_len, BQ_hj); } std::string GetInfo(std::string str) { char buffer[512]; - sprintf(buffer, "%s>>bDetSupport %d bDetHandle %d bDetTag %d x_standard %f y_standard %f x_offset %f y_offset %f r_offset %f edge num %ld handleRegion num %ld handle_diff %f BQ[area %f energy %f len %f hj %f]\n", - str.c_str(), bDetSupport, bDetHandle, bDetTag, x_standard, y_standard, x_offset, y_offset, r_offset, edge_select.size(), handleRegions.size(), handle_diff, BQ_area, BQ_energy, BQ_len, BQ_hj); + sprintf(buffer, "%s>>bDetSupport %d bDrawSupport %d bDetHandle %d bDetTag %d x_standard %f y_standard %f x_offset %f y_offset %f r_offset %f edge num %ld handleRegion num %ld handle_diff %f BQ[area %f energy %f len %f hj %f]\n", + str.c_str(), bDetSupport, bDrawSupport, bDetHandle, bDetTag, x_standard, y_standard, x_offset, y_offset, r_offset, edge_select.size(), handleRegions.size(), handle_diff, BQ_area, BQ_energy, BQ_len, BQ_hj); std::string str123 = buffer; return str123; } diff --git a/ConfigModule/src/JsonConfig.cpp b/ConfigModule/src/JsonConfig.cpp index 4d0bc20..1d3950b 100644 --- a/ConfigModule/src/JsonConfig.cpp +++ b/ConfigModule/src/JsonConfig.cpp @@ -921,6 +921,12 @@ int BaseFuntonConfigJson::GetFunction(Json::Value value) { auto value_param = value_f["form"]["support_param"]; + // 支架绘制开关:控制结果图上是否绘制支架中心十字/距离线(默认关,兼容旧参数) + if (value_param["bDrawSupport"].isBool()) + { + _config.supportDet.bDrawSupport = value_param["bDrawSupport"].asBool(); + } + if (value_param["x_standard"]) { _config.supportDet.x_standard = value_param["x_standard"].asFloat();