|
|
|
|
@ -4,6 +4,10 @@
|
|
|
|
|
#include "Define.h"
|
|
|
|
|
#include <omp.h>
|
|
|
|
|
#include "AICommonDefine.h"
|
|
|
|
|
// BQ blob 来源标记:写入 ERROR_DOTS_BLOB_DATA::UserErrorType 字段。
|
|
|
|
|
// BQ blob 的分类结果会覆盖 ErrType,用该标记记录来源掩码是 BQ mask,
|
|
|
|
|
// 供 CalBlob_Other / CalBLobMean_GrayDis 在计算能量、灰度时选中正确的 mask。
|
|
|
|
|
static const int BQ_BLOB_SOURCE_FLAG = -100;
|
|
|
|
|
// 用于排序轮廓的比较函数
|
|
|
|
|
static bool compareContourAreas(const vector<Point> &contour1, const vector<Point> &contour2)
|
|
|
|
|
{
|
|
|
|
|
@ -170,7 +174,7 @@ int ImgCheckAnalysisy::GetStatus()
|
|
|
|
|
|
|
|
|
|
std::string ImgCheckAnalysisy::GetVersion()
|
|
|
|
|
{
|
|
|
|
|
return std::string("BOE_1.3.9_" + std::string(__DATE__) + "_" + std::string(__TIME__));
|
|
|
|
|
return std::string("BOE_1.3.10_" + std::string(__DATE__) + "_" + std::string(__TIME__));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string ImgCheckAnalysisy::GetErrorInfo()
|
|
|
|
|
@ -306,8 +310,7 @@ cv::Scalar ImgCheckAnalysisy::calc_blob_info_withstats(cv::Mat &img, const cv::M
|
|
|
|
|
// CheckUtil::printROI(roi, "roi-----------");
|
|
|
|
|
// printf("img --%d %d \n", img.cols, img.rows);
|
|
|
|
|
// printf("mask --%d %d \n", mask.cols, mask.rows);
|
|
|
|
|
cv::Mat cmask = mask(roi);
|
|
|
|
|
// getchar();
|
|
|
|
|
cv::Mat cmask = mask(roi); // getchar();
|
|
|
|
|
// 扩张掩膜
|
|
|
|
|
|
|
|
|
|
cv::Scalar mean_bk = cv::mean(cimg, ~cmask);
|
|
|
|
|
@ -746,8 +749,13 @@ int ImgCheckAnalysisy::CalBlob_Other()
|
|
|
|
|
int config_qx_type = blobs.blobTab[i].ErrType;
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<ImageAllResult::Image_AI_Det_Result> pDetAIResult = m_pImageAllResult->qx_DetAIResult;
|
|
|
|
|
// BQ 标签检测的 blob:来源 mask 是 BQ mask(分类线程会改 ErrType,靠 UserErrorType 标记识别)
|
|
|
|
|
if (blobs.blobTab[i].UserErrorType == BQ_BLOB_SOURCE_FLAG && m_pImageAllResult->bq_DetAIResult)
|
|
|
|
|
{
|
|
|
|
|
pDetAIResult = m_pImageAllResult->bq_DetAIResult;
|
|
|
|
|
}
|
|
|
|
|
// 127cell 检测类型。
|
|
|
|
|
if (config_qx_type == CONFIG_QX_NAME_white_Cell || config_qx_type == CONFIG_QX_NAME_black_Cell)
|
|
|
|
|
else if (config_qx_type == CONFIG_QX_NAME_white_Cell || config_qx_type == CONFIG_QX_NAME_black_Cell)
|
|
|
|
|
{
|
|
|
|
|
pDetAIResult = m_pImageAllResult->cell127_DetAIResult;
|
|
|
|
|
}
|
|
|
|
|
@ -1091,8 +1099,13 @@ int ImgCheckAnalysisy::CalBLobMean_GrayDis()
|
|
|
|
|
int config_qx_type = blobs.blobTab[i].ErrType;
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<ImageAllResult::Image_AI_Det_Result> pDetAIResult = m_pImageAllResult->qx_DetAIResult;
|
|
|
|
|
// BQ 标签检测的 blob:来源 mask 是 BQ mask(分类线程会改 ErrType,靠 UserErrorType 标记识别)
|
|
|
|
|
if (blobs.blobTab[i].UserErrorType == BQ_BLOB_SOURCE_FLAG && m_pImageAllResult->bq_DetAIResult)
|
|
|
|
|
{
|
|
|
|
|
pDetAIResult = m_pImageAllResult->bq_DetAIResult;
|
|
|
|
|
}
|
|
|
|
|
// 127cell 检测类型。
|
|
|
|
|
if (config_qx_type == CONFIG_QX_NAME_white_Cell || config_qx_type == CONFIG_QX_NAME_black_Cell)
|
|
|
|
|
else if (config_qx_type == CONFIG_QX_NAME_white_Cell || config_qx_type == CONFIG_QX_NAME_black_Cell)
|
|
|
|
|
{
|
|
|
|
|
pDetAIResult = m_pImageAllResult->cell127_DetAIResult;
|
|
|
|
|
}
|
|
|
|
|
@ -2602,6 +2615,7 @@ int ImgCheckAnalysisy::GetBlob_BQ()
|
|
|
|
|
for (int i = 0; i < blobs_bq.blobCount; i++)
|
|
|
|
|
{
|
|
|
|
|
blobs_bq.blobTab[i].ErrType = CONFIG_QX_NAME_LD; // 以亮点作为初始类型,后续分类修正
|
|
|
|
|
blobs_bq.blobTab[i].UserErrorType = BQ_BLOB_SOURCE_FLAG; // 标记来源=BQ mask,能量/灰度按 BQ mask 计算
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 将BQ的blob汇入主blob列表
|
|
|
|
|
|