1. 程式人生 > 其它 >PCL學習筆記(三):PCL的點型別

PCL學習筆記(三):PCL的點型別

資料型別

基礎類

pcl::PointCloud
pcl::PointCloud::width:點雲寬度
pcl::PointCloud::height:點雲高度
pcl::PointCloud::points:點雲中包含的點
pcl:`PointCloud<pcl::PointCloud::isOrganized:點雲有無組織

//有組織點
cloud.width = 640; // Image-like organized structure, with 480 rows and 640 columns,
cloud.height = 480; // thus 640*480=307200 points total in the dataset

//無組織點 cloud.width = 307200; cloud.height = 1; // unorganized point cloud dataset with 307200 points //點雲陣列向量 pcl::PointCloud<pcl::PointXYZ> cloud; std::vector<pcl::PointXYZ> data = cloud.points; 判斷組織 if (!cloud.isOrganized ()) ...

模板型別

對於模板型別,只需要熟悉大概有什麼型別可用,使用時翻閱文件就可以了。

使用中會發現型別中通常包含一個用於SSE對齊的資料,感興趣可以簡單瞭解一下,Sreaming SIMD Extensions, 它是一組CPU指令,用於像訊號處理、科學計算或者3D圖形計算一樣的應用,但是SSE對於資料是有很多種格式要求的,其中就有對齊這一點,所以就有了這一部分的操作

PointXYZ - Members: float x, y, z


最常用的資料型別之一,只表示3D xyz資訊。這3個浮點數用一個附加浮點數進行填充,以進行SSE對齊。使用者可以訪問點[i].data[0]或點[i].x

    union
    {
     float data[4];
      struct
      {
       float x;
       float y;
       float z;
      };
    };



PointXYZI - Members: float x, y, z, intensity
XYZ+強度型別。在理想情況下,這4部分將建立一個單一的結構,SSE對齊。但是,由於大多數點操作會將data[4]陣列的第四部分設定為0或1(用於轉換),因此不能將intensity設定為同一結構的成員,因為它的內容將被覆蓋。例如,兩點之間的點積將其第四個分量設定為0,否則點積就沒有意義,等等。
因此,對於SSE對齊,我們使用3個額外的浮動來填充強度。在儲存方面效率低,但在記憶體對齊方面很好。

    union
    {
      float data[4];
      struct
      {
       float x;
       float y;
       float z;
      };
    };
    union
    {
     struct
      {
        float intensity;
      };
      float data_c[4];
    };


PointXYZRGBA - Members: float x, y, z; std::uint32_t rgba
與PointXYZI類似,除了rgba包含打包成無符號32位整數的rgba資訊外。由於聯合宣告,還可以按名稱單獨訪問顏色通道。

    union
    {
     float data[4];
     struct
      {
       float x;
       float y;
       float z;
      };
    };
    union
    {
      union
      {
        struct
        {
          std::uint8_t b;
          std::uint8_t g;
          std::uint8_t r;
         std::uint8_t a;
        };
        float rgb;
      };
    std::uint32_t rgba;
    };


PointXYZRGB - float x, y, z; std::uint32_t rgba 與PointXYZRGBA相同

PointXY - *float x, y

InterestPoint - float x, y, z, strength
與PointXYZI類似,除了強度包含關鍵點強度的度量

Normal - float normal[3], curvature
最常用之一,表示給定點處的曲面法向,以及曲率的度量

PointNormal - float x, y, z; float normal[3], curvature
儲存XYZ資料、曲面法線和曲率的點結構。

PointXYZRGBNormal - float x, y, z, normal[3], curvature; std::uint32_t rgba
儲存XYZ資料、RGBA顏色以及曲面法線和曲率的點結構。

PointXYZINormal - float x, y, z, intensity, normal[3], curvature
儲存XYZ資料和強度值以及曲面法線和曲率的點結構。

PointWithRange - float x, y, z (union with float point[4]), range
與PointXYZI類似,除了range包含從獲取視點到世界上的點的距離的度量。

PointWithViewpoint - float x, y, z, vp_x, vp_y, vp_z
與點xyzi類似,除了vp_x、vp_y和vp_z包含作為3D點的採集視點

MomentInvariants - float j1, j2, j3
在曲面片上保持3個不變矩的簡單點型別。

PrincipalRadiiRSD - float r_min, r_max
在曲面片上保持2 RSD半徑的簡單點型別

Boundary - std::uint8_t boundary_point
簡單點型別,用於儲存點是否位於曲面邊界上

PrincipalCurvatures -* float principal_curvature[3], pc1, pc2*
保持給定點的主曲率的簡單點型別。

PFHSignature125 - float pfh[125]
包含給定點的PFH(點特徵直方圖)的簡單點型別。

FPFHSignature33 - float fpfh[33]
包含給定點的FPFH(快速點特徵直方圖)的簡單點型別

VFHSignature308 - float vfh[308]
包含給定點的VFH(視點特徵直方圖)的簡單點型別

Narf36 - float x, y, z, roll, pitch, yaw; float descriptor[36]
保持給定點的NARF(通常對齊的半徑特徵)的簡單點型別

BorderDescription - int x, y; BorderTraits traits
儲存給定點的邊界型別的簡單點型別

IntensityGradient -* float gradient[3]*
保持給定點的強度梯度的簡單點型別

Histogram - float histogram[N]
通用n-D直方圖佔位符

PointWithScale - float x, y, z, scale
與PointXYZI類似,除了scale包含考慮某個點進行幾何操作的比例

PointSurfel - float x, y, z, normal[3], rgba, radius, confidence, curvature
包含XYZ資料、曲面法線、RGB資訊、比例、置信度和曲面曲率的複雜點型別

自定義型別

struct MyPointType
{
  float test;
};



————————————————
版權宣告:本文為CSDN博主「CallMe航仔」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處連結及本宣告。
原文連結:https://blog.csdn.net/tobebest_lah/article/details/106241406