72 lines
2.4 KiB
C++
72 lines
2.4 KiB
C++
#ifndef IYHOLEPITPOSITIONSTATUS_H
|
||
#define IYHOLEPITPOSITIONSTATUS_H
|
||
|
||
#include <string>
|
||
#include <functional>
|
||
#include <vector>
|
||
#include <QImage>
|
||
#include <QMetaType>
|
||
|
||
#include "IVisionApplicationStatus.h"
|
||
|
||
/**
|
||
* @brief 凹坑孔定位详细结果数据
|
||
*/
|
||
struct HoleResultData {
|
||
float centerX = 0.0f, centerY = 0.0f, centerZ = 0.0f; // 孔洞中心
|
||
float normalX = 0.0f, normalY = 0.0f, normalZ = 0.0f; // 法向量
|
||
float radius = 0.0f; // 半径 (mm)
|
||
float depth = 0.0f; // 深度 (mm)
|
||
float eccentricity = 0.0f; // 离心率
|
||
float radiusVariance = 0.0f; // 半径方差
|
||
float angularSpan = 0.0f; // 角度跨度
|
||
float qualityScore = 0.0f; // 质量分数 (0-1)
|
||
|
||
HoleResultData() = default;
|
||
HoleResultData(const HoleResultData&) = default;
|
||
HoleResultData& operator=(const HoleResultData&) = default;
|
||
};
|
||
|
||
// 孔位置结构体(机器人坐标系下的6DOF位姿)
|
||
struct HolePosition : public PositionData<double> {
|
||
HolePosition() : PositionData<double>() {}
|
||
|
||
HolePosition(double _x, double _y, double _z, double _roll, double _pitch, double _yaw)
|
||
: PositionData<double>(_x, _y, _z, _roll, _pitch, _yaw) {}
|
||
|
||
HolePosition(const HolePosition&) = default;
|
||
HolePosition& operator=(const HolePosition&) = default;
|
||
|
||
HolePosition(const PositionData<double>& pos)
|
||
: PositionData<double>(pos) {}
|
||
};
|
||
|
||
// 凹坑孔定位检测结果结构体
|
||
struct HoleDetectionResult : public DetectionResultData<HolePosition> {
|
||
std::vector<HoleResultData> holeDetails;
|
||
int totalCandidates = 0;
|
||
int filteredCount = 0;
|
||
|
||
HoleDetectionResult() = default;
|
||
HoleDetectionResult(const HoleDetectionResult&) = default;
|
||
HoleDetectionResult& operator=(const HoleDetectionResult&) = default;
|
||
};
|
||
|
||
// 状态回调接口
|
||
class IYHolePitPositionStatus : public IVisionApplicationStatus<HoleDetectionResult>
|
||
{
|
||
public:
|
||
virtual ~IYHolePitPositionStatus() = default;
|
||
};
|
||
|
||
// 类型别名,供外部使用统一命名
|
||
using HolePitPositionResult = HoleDetectionResult;
|
||
using HolePitPosition = HolePosition;
|
||
using HolePitResultData = HoleResultData;
|
||
|
||
Q_DECLARE_METATYPE(HoleDetectionResult)
|
||
Q_DECLARE_METATYPE(HolePosition)
|
||
Q_DECLARE_METATYPE(HoleResultData)
|
||
|
||
#endif // IYHOLEPITPOSITIONSTATUS_H
|