algoLib/sourceCode/SG_fireBrickAlgo.h
2025-06-08 10:46:41 +08:00

92 lines
2.1 KiB
C++

/**
******************************************************************************
* @file SG_fireBrickAlgo.h
* @author 上古软件
* @version V1.0.0
* @date 2024-10-30
* @brief This file contains all the functions prototypes for the fireBrick
* positioning algorithm.
******************************************************************************
*/
#pragma once
#include <VZNL_Types.h>
#include <vector>
#include <string>
#include "SG_fireBrick_Export.h"
#include "SG_baseDataType.h"
#define Z_HIST_MAX_SIZE 100000
#define ENABLE_OUTPUT_DEBUG_IMAGE 1 //输出中间调试结果
typedef struct
{
int start;
int len;
int value;
}SSG_RunData;
typedef struct
{
SVzNL2DPoint gridPos;
SSG_meanVar meanVar;
}SSG_meanVarAbnormalPt;
typedef struct
{
uchar isClosed;
std::vector<SVzNL2DPoint> contourPtList;
}SSG_RgnContour2D;
typedef struct
{
SVzNL2DPoint gridPos;
SVzNL3DPoint pt3D;
}SSG_gridPt3D;
typedef struct
{
uchar isClosed;
std::vector<SSG_gridPt3D> contourPtList;
}SSG_RgnContour3D;
class CSGFireBrick : public ISGFireBrick
{
public:
CSGFireBrick();
~CSGFireBrick() final = default;
/// @brief
/// 创建实例
static bool CreateInstance(double dHistScale, ISGFireBrick** ppFireBrick);
const char* GetVersion() final;
void sgSegHistScale(double) final;
void sgCalibCamPose() final;
void sgSetPoseSortingMode(ESG_poseSortingMode mode) final;
ESG_poseSortingMode sgGetPoseSortingMode() final;
void sgScanLineProc(SVzNL3DLaserLine* a_line, double* camPoseR, int* errCode) final;
void sgGetBrickPose(SVzNL3DLaserLine* scanData, int nLines, std::vector<SSG_6AxisAttitude>& brickPoses, int* errCode) final;
void sgSortBrickPoses(std::vector<SSG_6AxisAttitude>& brickPoses, ESG_poseSortingMode sortingMode) final;
protected:
/// @brief
/// 初始化
bool _Init(double dHistScale);
private:
int m_nFrameWidth = -1;
int m_nFrameHeight = 0;
double m_histScale = 0.5;
double m_planeThick = 6.0;
std::vector<int> m_zHist;
ESG_poseSortingMode m_sortingMode = keSG_PoseSorting_Uknown;
SVzNLRange m_zIdxRange = { -1, -1 };
//
static std::string m_strVersion;
};