feat: 重新规划ui布局;增加左右红外以及rgb相机可视化

This commit is contained in:
2026-01-21 15:36:47 +08:00
parent 8b07397b5b
commit 93c7c1a86b
10 changed files with 1287 additions and 352 deletions

View File

@@ -284,30 +284,29 @@ void PointCloudProcessor::processPointCloudData(const QByteArray &cloudData, uin
const int16_t* cloudShort = reinterpret_cast<const int16_t*>(cloudData.constData());
if (isZOnly) {
// Z-only格式直接映射为平面点云(类似图像平面
// X对应列左右翻转Y对应行上下翻转Z是深度值
// qDebug() << "[PointCloud] Processing Z-only format as planar mapping";
// Z-only格式转换为正交投影(柱形
for (size_t i = 0; i < m_totalPoints; i++) {
int row = i / m_imageWidth;
int col = i % m_imageWidth;
// 直接映射X=列翻转Y=行翻转Z=深度
float x = static_cast<float>(m_imageWidth - 1 - col); // 左右翻转
float y = static_cast<float>(m_imageHeight - 1 - row); // 上下翻转
// 读取深度值(单位:毫米)
float z = static_cast<float>(cloudShort[i]) * m_zScale;
cloud->points[i].x = x;
cloud->points[i].y = y;
// 正交投影X、Y使用像素坐标Y轴翻转以修正镜像
cloud->points[i].x = static_cast<float>(col);
cloud->points[i].y = static_cast<float>(m_imageHeight - 1 - row);
cloud->points[i].z = z;
}
} else {
// XYZ格式完整的三维坐标
// qDebug() << "[PointCloud] Processing XYZ format";
// 转换为正交投影柱形使用像素坐标作为X、Y
for (size_t i = 0; i < m_totalPoints; i++) {
cloud->points[i].x = static_cast<float>(cloudShort[i * 3 + 0]) * m_zScale;
cloud->points[i].y = static_cast<float>(cloudShort[i * 3 + 1]) * m_zScale;
int row = i / m_imageWidth;
int col = i % m_imageWidth;
// 正交投影X、Y使用像素坐标Y轴翻转以修正镜像Z使用深度值
cloud->points[i].x = static_cast<float>(col);
cloud->points[i].y = static_cast<float>(m_imageHeight - 1 - row);
cloud->points[i].z = static_cast<float>(cloudShort[i * 3 + 2]) * m_zScale;
}
}