feat: 添加点云去噪及其参数调整
This commit is contained in:
@@ -257,17 +257,18 @@ void PointCloudGLWidget::updatePointCloud(pcl::PointCloud<pcl::PointXYZ>::Ptr cl
|
||||
|
||||
for (const auto& point : cloud->points) {
|
||||
if (point.z > 0.01f) { // 过滤掉无效的零点
|
||||
const float displayZ = -point.z; // Flip front/back axis for viewer convention.
|
||||
m_vertices.push_back(point.x);
|
||||
m_vertices.push_back(-point.y);
|
||||
m_vertices.push_back(point.z);
|
||||
m_vertices.push_back(displayZ);
|
||||
|
||||
// 更新包围盒
|
||||
if (point.x < minX) minX = point.x;
|
||||
if (point.x > maxX) maxX = point.x;
|
||||
if (point.y < minY) minY = point.y;
|
||||
if (point.y > maxY) maxY = point.y;
|
||||
if (point.z < minZ) minZ = point.z;
|
||||
if (point.z > maxZ) maxZ = point.z;
|
||||
if (displayZ < minZ) minZ = displayZ;
|
||||
if (displayZ > maxZ) maxZ = displayZ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user