pcl::Normal的定义以及cout

本文深入探讨了PCL (Point Cloud Library) 中Normal结构的定义与使用,包括其成员变量normal_x, normal_y, normal_z 和 curvature的含义,以及如何通过不同方式访问这些数据。此外,还介绍了Normal结构的多种构造函数和操作符,为理解点云法向量估计提供了实用指南。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. pcl::Normal在pcl官网中的定义
 /*brief A point structure representing normal coordinates and the surface curvature estimate. (SSE friendly)ingroup common*/

struct Normal : public _Normal
{
    inline Normal (const _Normal &p)
    {
     normal_x = p.normal_x; 
     normal_y = p.normal_y; 
     normal_z = p.normal_z;
     data_n[3] = 0.0f;
     curvature = p.curvature;
    }

    inline Normal ()
    {
     normal_x = normal_y = normal_z = data_n[3] = 0.0f;
     curvature = 0;
    }

    inline Normal (float n_x, float n_y, float n_z)
    {
     normal_x = n_x; normal_y = n_y; normal_z = n_z;
     curvature = 0;
     data_n[3] = 0.0f;
    }

    friend std::ostream& operator << (std::ostream& os, const Normal& p);
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};

2. 官网 tutorial中的资料
union{
float data_n[4]
float normal[3];
struct
{
float normal_x;
float normal_y;
float normal_z;
};
};
union{
struct{
float curvature;
};
float data_c[4];
};

看出,pcl::Normals normal的四个值表示(normal_x, normal_y, normal_z, curvature);

3. 表示pcl::Normal的几种方式:
pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal>); 
std::cout<<normals->points[100]<<std::endl;
std::cout<<"["<<normals->points[100].normal_x<<" "
              <<normals->points[100].normal_y<<" "
              <<normals->points[100].normal_z<<" "
              <<normals->points[100].curvature<<"]"<<endl;

std::cout<<"["<<normals->points[100].normal[0]<<" "
              <<normals->points[100].normal[1]<<" "
              <<normals->points[100].normal[2]<<" "
              <<normals->points[100].curvature<<"]"<<endl;

std::cout<<"["<<normals->points[100].data_n[0]<<" "
              <<normals->points[100].data_n[1]<<" "
              <<normals->points[100].data_n[2]<<" "
              <<normals->points[100].curvature<<"]"<<endl;

4. 参考
point_types——官网tutorial 
point_types——中文版

pcl::Normal构造函数——官网doc 
pcl::Normal详细——官网doc

how features work包含Normal的一些使用例子——官网tutorial

估计法向量——官网tutorial 
估计法向量——中文版

添加箭头arrow——官网doc


--------------------- 
原文:https://blog.youkuaiyun.com/coldplayplay/article/details/79265444?utm_source=copy 
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值