增加顶部摄像头使用箱角进行切分
This commit is contained in:
parent
7883c96736
commit
a582dfb23b
|
|
@ -55,11 +55,11 @@ namespace ai_matrix
|
|||
dataSourceConfig.strUrl = it["url"].as<std::string>();
|
||||
dataSourceConfig.iSkipInterval = it["skip_interval"].as<int>();
|
||||
dataSourceConfig.vecIdentifyAreas = it["identify_areas"].as<std::vector<int>>();
|
||||
dataSourceConfig.strDivideModel = it["divide_mode"].as<std::string>();
|
||||
this->vecDataSourceConfig_.emplace_back(dataSourceConfig);
|
||||
}
|
||||
|
||||
// 识别参数
|
||||
this->identifyConfig_.strRunModel = config_["identify"]["run_mode"].as<std::string>();
|
||||
this->identifyConfig_.iPartitionFrameSpan = config_["identify"]["partition_frame_span"].as<int>();
|
||||
this->identifyConfig_.iTop_Y_SplitSpanPx = config_["identify"]["top_y_split_span_px"].as<int>();
|
||||
this->identifyConfig_.iSide_X_SplitSpanPx = config_["identify"]["side_x_split_span_px"].as<int>();
|
||||
|
|
|
|||
|
|
@ -62,12 +62,12 @@ namespace ai_matrix
|
|||
int iSkipInterval;
|
||||
// 识别区域
|
||||
std::vector<int> vecIdentifyAreas;
|
||||
// 切箱方式
|
||||
std::string strDivideModel;
|
||||
};
|
||||
|
||||
// 识别参数
|
||||
struct IdentifyConfig {
|
||||
// 运行方式
|
||||
std::string strRunModel;
|
||||
// 大框帧跨度(比一个大框从出现到消失的跨度稍大一点, 跟跳帧有关系)
|
||||
int iPartitionFrameSpan;
|
||||
// 顶部Y轴大框帧跨度的位置像素差异
|
||||
|
|
|
|||
|
|
@ -30,23 +30,29 @@ data_source:
|
|||
skip_interval: 3
|
||||
# 识别区域
|
||||
identify_areas: [120, 0, 1800, 1080]
|
||||
# 切箱方式
|
||||
divide_mode: "corner" #[corner, pixel]
|
||||
- # 侧部摄像头
|
||||
url: "./videos/buertai2.mp4"
|
||||
# 跳帧数
|
||||
skip_interval: 3
|
||||
# 识别区域
|
||||
identify_areas: [ 120, 0, 1800, 1080 ]
|
||||
# 切箱方式
|
||||
divide_mode: "pixel" #[corner, pixel]
|
||||
- # 侧边摄像头
|
||||
url: "./videos/buertai2.mp4"
|
||||
# 跳帧数
|
||||
skip_interval: 3
|
||||
# 识别区域
|
||||
identify_areas: [ 120, 0, 1800, 1080 ]
|
||||
# 切箱方式
|
||||
divide_mode: "pixel" #[corner, pixel]
|
||||
|
||||
# 识别参数
|
||||
identify:
|
||||
# 运行方式
|
||||
run_mode: "command" #[always; command]
|
||||
# 切箱方式
|
||||
divide_mode: "corner" #[corner, pixel]
|
||||
# 大框帧跨度(比一个大框从出现到消失的跨度稍大一点, 跟跳帧有关系)
|
||||
partition_frame_span: 0
|
||||
# 顶部Y轴大框帧跨度的位置像素差异
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ APP_ERROR ToMinioSrvEngine::Process()
|
|||
else
|
||||
{
|
||||
LogInfo << "数据上传MinIO 成功!!"
|
||||
<< this->minioConfig_.strBucket + strMinIoPath
|
||||
<< this->minioConfig_.strBucket + "/" + strMinIoPath
|
||||
<< " -->"
|
||||
<< strLocalPath;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -23,6 +23,9 @@ public:
|
|||
private:
|
||||
void initParam();
|
||||
void divideInfo(std::shared_ptr<VStep2OutputData> pVStep2OutputData);
|
||||
void divideByPixelInfo(std::shared_ptr<VStep2OutputData> pVStep2OutputData);
|
||||
void divideByCornerInfo(std::shared_ptr<VStep2OutputData> pVStep2OutputData);
|
||||
void setectBestByCorner();
|
||||
void sendBestData(const VSelectBestData& selectBestData);
|
||||
void makeResult(const std::shared_ptr<VStep2OutputData>& pVStep2OutputData,
|
||||
VSelectBestData & selectBestData) const;
|
||||
|
|
@ -33,6 +36,7 @@ private:
|
|||
ai_matrix::BaseConfig baseConfig_;
|
||||
ai_matrix::IdentifyConfig identifyConfig_;
|
||||
ai_matrix::DataSourceConfig dataSourceConfig_;
|
||||
std::vector<ai_matrix::DataSourceConfig> vecDataSourceConfig_;
|
||||
|
||||
std::shared_ptr<VStep2OutputData> pVStep2OutputDataPre_ = nullptr;
|
||||
|
||||
|
|
@ -43,7 +47,10 @@ private:
|
|||
// 临时存储的正确结果
|
||||
std::string stdContainerResult_;
|
||||
|
||||
// 存储识别到的不满足校验规则的箱号数据
|
||||
std::vector<VSelectBestData> vecContainerFail_;
|
||||
// 存储识别到的满足校验规则的箱号数据
|
||||
std::vector<VSelectBestData> vecContainer_;
|
||||
};
|
||||
|
||||
ENGINE_REGIST(ContainerDivideEngine)
|
||||
|
|
|
|||
|
|
@ -180,8 +180,8 @@ void ContainerStep1InferenceEngine::filterInvalidInfo(std::vector<stDetection> &
|
|||
it->bbox[2] <= this->dataSourceConfig_.vecIdentifyAreas[2] &&
|
||||
it->bbox[3] <= this->dataSourceConfig_.vecIdentifyAreas[3]))
|
||||
{
|
||||
LogDebug << " 数据源:" << pVDetectInfo->iDataSource
|
||||
<< " frameId:" << pVDetectInfo->iFrameId
|
||||
LogDebug << " 帧:" << pVDetectInfo->iFrameId
|
||||
<< " 数据源:" << pVDetectInfo->iDataSource
|
||||
<< " 类别:" << it->class_id
|
||||
<< " 坐标:[" << it->bbox[0]
|
||||
<< "," << it->bbox[1]
|
||||
|
|
@ -200,8 +200,8 @@ void ContainerStep1InferenceEngine::filterInvalidInfo(std::vector<stDetection> &
|
|||
// 剔出反向集装箱
|
||||
if (it->class_id == MIRROR_CONTAINER)
|
||||
{
|
||||
// LogDebug << " 数据源:" << pVDetectInfo->iDataSource
|
||||
// << " frameId:" << pVDetectInfo->iFrameId
|
||||
// LogDebug << " 帧:" << pVDetectInfo->iFrameId
|
||||
// << " 数据源:" << pVDetectInfo->iDataSource
|
||||
// << " bigclassid:" << it->class_id << " 过滤 剔出反向集装箱";
|
||||
it = vecInferenceResult.erase(it);
|
||||
continue;
|
||||
|
|
@ -210,8 +210,8 @@ void ContainerStep1InferenceEngine::filterInvalidInfo(std::vector<stDetection> &
|
|||
// 剔除高度小于最低限制的大框
|
||||
if ((it->bbox[3] - it->bbox[1]) < this->identifyConfig_.iTargetMinHeight && pVDetectInfo->iDataSource != 0)
|
||||
{
|
||||
// LogDebug << " 数据源:" << pVDetectInfo->iDataSource
|
||||
// << " frameId:" << pVDetectInfo->iFrameId
|
||||
// LogDebug << " 帧:" << pVDetectInfo->iFrameId
|
||||
// << " 数据源:" << pVDetectInfo->iDataSource
|
||||
// << " bigclassid:" << it->class_id << " 过滤 大框高度小于最小值,疑似非目标区域";
|
||||
it = vecInferenceResult.erase(it);
|
||||
continue;
|
||||
|
|
@ -219,8 +219,8 @@ void ContainerStep1InferenceEngine::filterInvalidInfo(std::vector<stDetection> &
|
|||
// 剔除宽度小于最低限制的大框
|
||||
if ((it->bbox[2] - it->bbox[0]) < this->identifyConfig_.iTargetMinWidth)
|
||||
{
|
||||
// LogDebug << " 数据源:" << pVDetectInfo->iDataSource
|
||||
// << " frameId:" << pVDetectInfo->iFrameId
|
||||
// LogDebug << " 帧:" << pVDetectInfo->iFrameId
|
||||
// << " 数据源:" << pVDetectInfo->iDataSource
|
||||
// << " bigclassid:" << it->class_id << " 过滤 大框宽度小于最小值,疑似非目标区域";
|
||||
it = vecInferenceResult.erase(it);
|
||||
continue;
|
||||
|
|
@ -229,8 +229,8 @@ void ContainerStep1InferenceEngine::filterInvalidInfo(std::vector<stDetection> &
|
|||
// 剔出左上角坐标在XXX以下的
|
||||
if (pVDetectInfo->iDataSource != 0 && it->bbox[1] > this->identifyConfig_.iTargetMinY)
|
||||
{
|
||||
// LogDebug << " 数据源:" << pVDetectInfo->iDataSource
|
||||
// << " frameId:" << pVDetectInfo->iFrameId
|
||||
// LogDebug << " 帧:" << pVDetectInfo->iFrameId
|
||||
// << " 数据源:" << pVDetectInfo->iDataSource
|
||||
// << " bigclassid:" << it->class_id << " 过滤 大框低于指定Y轴坐标,疑似误识别非目标";
|
||||
it = vecInferenceResult.erase(it);
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in New Issue