2024-11-24 00:58:06 +00:00
|
|
|
/**
|
|
|
|
|
* 保存第一步结果信息
|
|
|
|
|
* */
|
|
|
|
|
|
|
|
|
|
#ifndef TRAINDIVIDEENGINE_H
|
|
|
|
|
#define TRAINDIVIDEENGINE_H
|
|
|
|
|
|
|
|
|
|
#include "AppCommon.h"
|
|
|
|
|
#include "EngineBase.h"
|
|
|
|
|
#include "EngineFactory.h"
|
|
|
|
|
#include "json/json.h"
|
|
|
|
|
|
|
|
|
|
class ContainerDivideEngine : public ai_matrix::EngineBase
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ContainerDivideEngine();
|
|
|
|
|
~ContainerDivideEngine();
|
|
|
|
|
|
|
|
|
|
APP_ERROR Init() override;
|
|
|
|
|
APP_ERROR DeInit() override;
|
|
|
|
|
APP_ERROR Process() override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void initParam();
|
|
|
|
|
void divideInfo(std::shared_ptr<VStep2OutputData> pVStep2OutputData);
|
2024-11-26 13:16:08 +00:00
|
|
|
void divideByPixelInfo(std::shared_ptr<VStep2OutputData> pVStep2OutputData);
|
|
|
|
|
void divideByCornerInfo(std::shared_ptr<VStep2OutputData> pVStep2OutputData);
|
2024-11-27 12:38:06 +00:00
|
|
|
bool setectBestByCorner();
|
2024-11-24 00:58:06 +00:00
|
|
|
void sendBestData(const VSelectBestData& selectBestData);
|
|
|
|
|
void makeResult(const std::shared_ptr<VStep2OutputData>& pVStep2OutputData,
|
|
|
|
|
VSelectBestData & selectBestData) const;
|
|
|
|
|
|
|
|
|
|
std::string strPort0_;
|
|
|
|
|
std::string strPort1_;
|
|
|
|
|
|
|
|
|
|
ai_matrix::BaseConfig baseConfig_;
|
|
|
|
|
ai_matrix::IdentifyConfig identifyConfig_;
|
|
|
|
|
ai_matrix::DataSourceConfig dataSourceConfig_;
|
2024-11-26 13:16:08 +00:00
|
|
|
std::vector<ai_matrix::DataSourceConfig> vecDataSourceConfig_;
|
2024-11-24 00:58:06 +00:00
|
|
|
|
|
|
|
|
std::shared_ptr<VStep2OutputData> pVStep2OutputDataPre_ = nullptr;
|
|
|
|
|
|
|
|
|
|
std::map<uint32_t, float> mapContainerCenterInfo_;
|
|
|
|
|
|
|
|
|
|
int iContainerIndex = 0;
|
|
|
|
|
|
|
|
|
|
// 临时存储的正确结果
|
|
|
|
|
std::string stdContainerResult_;
|
|
|
|
|
|
2024-11-26 13:16:08 +00:00
|
|
|
// 存储识别到的不满足校验规则的箱号数据
|
2024-11-24 00:58:06 +00:00
|
|
|
std::vector<VSelectBestData> vecContainerFail_;
|
2024-11-26 13:16:08 +00:00
|
|
|
// 存储识别到的满足校验规则的箱号数据
|
|
|
|
|
std::vector<VSelectBestData> vecContainer_;
|
2025-02-14 10:26:43 +00:00
|
|
|
|
|
|
|
|
bool bLastIsEnd = true;
|
2024-11-24 00:58:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ENGINE_REGIST(ContainerDivideEngine)
|
|
|
|
|
|
|
|
|
|
#endif
|