2025-07-23 01:35:14 +08:00
|
|
|
#ifndef POINTCLOUDIMAGEUTILS_H
|
|
|
|
|
#define POINTCLOUDIMAGEUTILS_H
|
|
|
|
|
|
|
|
|
|
#include <QImage>
|
|
|
|
|
#include <QColor>
|
|
|
|
|
#include <vector>
|
2025-09-14 14:51:38 +08:00
|
|
|
|
|
|
|
|
#include "SG_baseDataType.h"
|
|
|
|
|
#include "SX_lapWeldDetection_Export.h"
|
2025-07-23 01:35:14 +08:00
|
|
|
|
|
|
|
|
class PointCloudImageUtils
|
|
|
|
|
{
|
|
|
|
|
public:
|
2025-09-14 14:51:38 +08:00
|
|
|
// 点云转图像 - 从LapWeldPresenter提取
|
2025-07-23 01:35:14 +08:00
|
|
|
static QImage GeneratePointCloudImage(SVzNL3DLaserLine* scanData,
|
|
|
|
|
int lineNum,
|
|
|
|
|
const std::vector<SSG_peakRgnInfo>& objOps);
|
|
|
|
|
|
|
|
|
|
static QImage GeneratePointCloudImage(SVzNLXYZRGBDLaserLine* scanData,
|
|
|
|
|
int lineNum,
|
|
|
|
|
const std::vector<SSG_peakOrienRgnInfo>& objOps);
|
2025-07-26 01:10:21 +08:00
|
|
|
|
|
|
|
|
// 新的点云图像生成函数 - 基于X、Y范围创建图像
|
|
|
|
|
static QImage GeneratePointCloudImage(SVzNLXYZRGBDLaserLine* scanData,
|
|
|
|
|
int lineNum);
|
2025-07-23 01:35:14 +08:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
// 定义线特征颜色和大小获取函数
|
|
|
|
|
static void GetLineFeatureStyle(int vType, int hType, int objId,
|
|
|
|
|
QColor& pointColor, int& pointSize);
|
|
|
|
|
|
|
|
|
|
// 获取对象颜色
|
|
|
|
|
static QColor GetObjectColor(int index);
|
|
|
|
|
|
|
|
|
|
// 计算点云范围
|
|
|
|
|
static void CalculatePointCloudRange(SVzNL3DLaserLine* scanData, int lineNum,
|
|
|
|
|
double& xMin, double& xMax,
|
|
|
|
|
double& yMin, double& yMax);
|
|
|
|
|
|
|
|
|
|
// 绘制目标检测结果
|
|
|
|
|
static void DrawDetectionTargets(QPainter& painter,
|
|
|
|
|
const std::vector<SSG_peakRgnInfo>& objOps,
|
|
|
|
|
double xMin, double xScale, int xSkip,
|
|
|
|
|
double yMin, double yScale, int ySkip,
|
|
|
|
|
int imgCols, int imgRows);
|
|
|
|
|
|
|
|
|
|
// 绘制目标检测结果
|
|
|
|
|
static void DrawDetectionTargets(QPainter& painter,
|
|
|
|
|
const std::vector<SSG_peakOrienRgnInfo>& objOps,
|
|
|
|
|
double xMin, double xScale, int xSkip,
|
|
|
|
|
double yMin, double yScale, int ySkip,
|
|
|
|
|
int imgCols, int imgRows);
|
|
|
|
|
};
|
|
|
|
|
|
2025-09-14 14:51:38 +08:00
|
|
|
#endif // POINTCLOUDIMAGEUTILS_H
|