algoLib/sourceCode/BQ_workpieceCornerExtraction_Export.h
2025-12-06 00:11:43 +08:00

68 lines
1.8 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "SG_algo_Export.h"
#include <vector>
#define _OUTPUT_DEBUG_DATA 1
typedef struct
{
double lineLen; //直线段长度
}SSX_BQworkpiecePara;
typedef struct
{
int workpieceType; //1-节点1 2-节点2 3-节点34-节点40-未知; 其它-非法
SVzNL3DPoint corner_L[3];
SVzNL3DPoint corner_R[3];
SVzNL3DPoint corner_T[3];
SVzNL3DPoint corner_B[3];
SVzNL3DPoint center; //工件中心点
double len135_A1; //A1长度从工件中心135度方向
double len45_B1; //B1长度从工件中心45度方向
double len315_B2; //B2长度从工件中心315度方向
double len225_A2; //A2长度从工件中心225度方向
}SSX_BQworkpieceResult;
typedef struct
{
int rgnIdx;
SVzNL3DPoint* edge;
int edge_size;
SVzNL3DPoint edge_ends[2];
SVzNL3DPoint* edgeLink_1;
int edgeLink1_size;
SVzNL3DPoint edge_link1_ends[2];
SVzNL3DPoint* edgeLink_2;
int edgeLink2_size;
SVzNL3DPoint edge_link2_ends[2];
}SSX_debugInfo;
//读版本号
SG_APISHARED_EXPORT const char* wd_BQWorkpieceCornerVersion(void);
//计算一个平面调平参数。
//数据输入中可以有一个地平面和参考调平平面,以最高的平面进行调平
//旋转矩阵为调平参数,即将平面法向调整为垂直向量的参数
SG_APISHARED_EXPORT SSG_planeCalibPara sx_BQ_getBaseCalibPara(
std::vector< std::vector<SVzNL3DPosition>>& scanLines);
//相机姿态调平,并去除地面
SG_APISHARED_EXPORT void sx_BQ_lineDataR(
std::vector< SVzNL3DPosition>& a_line,
const double* camPoseR,
double groundH);
//提取工件角点及定位长度信息
SG_APISHARED_EXPORT SSX_BQworkpieceResult sx_BQ_getWorkpieceCorners(
std::vector< std::vector<SVzNL3DPosition>>& scanLines,
const SSG_cornerParam cornerPara,
const SSG_outlierFilterParam filterParam,
SSG_treeGrowParam growParam,
SSG_planeCalibPara groundCalibPara,
SSX_BQworkpiecePara workpieceParam,
#if _OUTPUT_DEBUG_DATA
SSX_debugInfo* debug_conturs,
#endif
int* errCode);