feat 返回缺陷信息新增缺陷等级字段(待实现缺陷分级逻辑)

dev_lsy
liusiyang 4 weeks ago
parent 58563d817c
commit c9b98e02d6

@ -30,6 +30,7 @@ struct QX_ERROR_INFO_
float fbreadth; float fbreadth;
int nconfig_qx_type; int nconfig_qx_type;
std::string qx_name; std::string qx_name;
std::string qx_level; // 缺陷等级
int maxValue; int maxValue;
int whiteOrBlack; int whiteOrBlack;
float grayDis; float grayDis;
@ -56,6 +57,7 @@ struct QX_ERROR_INFO_
flen = 0; flen = 0;
nconfig_qx_type = 0; nconfig_qx_type = 0;
qx_name = ""; qx_name = "";
qx_level = "";
maxValue = 0; maxValue = 0;
grayDis = 0; grayDis = 0;
fUpIou = 0; fUpIou = 0;
@ -82,6 +84,7 @@ struct QX_ERROR_INFO_
<< ", Flen: " << flen << ", Flen: " << flen
<< ", nconfig_qx_type: " << nconfig_qx_type << ", nconfig_qx_type: " << nconfig_qx_type
<< ", QX Name: " << qx_name << ", QX Name: " << qx_name
<< ", QX Level: " << qx_level
<< ", Max Value: " << maxValue << ", Max Value: " << maxValue
<< ", Gray Dis: " << grayDis << ", Gray Dis: " << grayDis
<< ", fUpIou: " << fUpIou << ", fUpIou: " << fUpIou

@ -280,6 +280,7 @@ struct QXImageResult
int type; // 缺陷类型 int type; // 缺陷类型
std::string qx_Code; // 缺陷code std::string qx_Code; // 缺陷code
std::string strTypeName; // 缺陷名称 std::string strTypeName; // 缺陷名称
std::string qx_level; // 缺陷等级
cv::Mat srcImg; // 缺陷原始图片 cv::Mat srcImg; // 缺陷原始图片
cv::Mat resizeImg; // 缺陷缩略图 cv::Mat resizeImg; // 缺陷缩略图
@ -344,6 +345,7 @@ struct QXImageResult
max_v = 0; max_v = 0;
strTypeName = ""; strTypeName = "";
qx_Code = ""; qx_Code = "";
qx_level = "";
len = 0; len = 0;
breadth = 0; breadth = 0;
idx = 0; idx = 0;

@ -50,6 +50,7 @@ Json::Value CheckResultJson::toJsonValue()
value["flen"] = p->flen; value["flen"] = p->flen;
value["nconfig_qx_type"] = p->nconfig_qx_type; value["nconfig_qx_type"] = p->nconfig_qx_type;
value["qx_name"] = p->qx_name; value["qx_name"] = p->qx_name;
value["qx_level"] = p->qx_level;
value["maxValue"] = p->maxValue; value["maxValue"] = p->maxValue;
value["grayDis"] = p->grayDis; value["grayDis"] = p->grayDis;
value["fUpIou"] = p->fUpIou; value["fUpIou"] = p->fUpIou;
@ -138,6 +139,7 @@ void CheckResultJson::toObjectFromValue(Json::Value root)
tem.flen = errorJson["flen"].asFloat(); tem.flen = errorJson["flen"].asFloat();
tem.nconfig_qx_type = errorJson["nconfig_qx_type"].asInt(); tem.nconfig_qx_type = errorJson["nconfig_qx_type"].asInt();
tem.qx_name = errorJson["qx_name"].asString(); tem.qx_name = errorJson["qx_name"].asString();
tem.qx_level = errorJson["qx_level"].asString();
tem.maxValue = errorJson["maxValue"].asInt(); tem.maxValue = errorJson["maxValue"].asInt();
tem.grayDis = errorJson["grayDis"].asFloat(); tem.grayDis = errorJson["grayDis"].asFloat();
tem.fUpIou = errorJson["fUpIou"].asFloat(); tem.fUpIou = errorJson["fUpIou"].asFloat();

@ -610,6 +610,7 @@ int ImageResultJudge::ResultJudge(std::shared_ptr<ImageAllResult> pImageResult)
tem.max_v = maxValue; tem.max_v = maxValue;
tem.strTypeName = QX_Result_Names[nqx_type]; tem.strTypeName = QX_Result_Names[nqx_type];
tem.qx_Code = QX_Result_Code[nqx_type]; tem.qx_Code = QX_Result_Code[nqx_type];
tem.qx_level = QX_info->qx_level;
// 缺陷 roi 映射回原图(按仿射矩阵映射, 否则按 CutRoi 平移) // 缺陷 roi 映射回原图(按仿射矩阵映射, 否则按 CutRoi 平移)
{ {
const cv::Mat &srcSizeImg = pImageResult->result->in_shareImage->img; const cv::Mat &srcSizeImg = pImageResult->result->in_shareImage->img;
@ -746,6 +747,7 @@ int ImageResultJudge::ResultJudge(std::shared_ptr<ImageAllResult> pImageResult)
tem.max_v = maxValue; tem.max_v = maxValue;
tem.strTypeName = QX_Result_Names[nqx_type]; tem.strTypeName = QX_Result_Names[nqx_type];
tem.qx_Code = QX_Result_Code[nqx_type]; tem.qx_Code = QX_Result_Code[nqx_type];
tem.qx_level = QX_info->qx_level;
// 缺陷 roi 映射回原图(按仿射矩阵映射, 否则按 CutRoi 平移) // 缺陷 roi 映射回原图(按仿射矩阵映射, 否则按 CutRoi 平移)
{ {
const cv::Mat &srcSizeImg = pImageResult->result->in_shareImage->img; const cv::Mat &srcSizeImg = pImageResult->result->in_shareImage->img;

Loading…
Cancel
Save