PCL中的基本的數據類型是點雲(PointCloud),是一個C++類。它包括以下成員:
1、width(int)
對於有組織的點雲數據,它代表數據集的寬度;
對於無組織的點雲數據,它代表該點雲中所有點的個數。
有組織點雲(organized point cloud),是類似圖像矩陣的有組織的點雲數據,被拆分爲行列,它能夠快速的根據空間關係進行近鄰操作,加快運算速度,降低使用PCL某些算法的成本。
例子:
cloud.width = 640; // there are 640 points per line
2、height(int)
對於有組織點雲數據,它代表點雲數據的高度(行數);
對於無組織點雲數據,它被規定爲1,這也是判定點雲數據集是否有組織的依據。
例子:
cloud.width = 640; // Image-like organized structure, with 640 rows and 480 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
3、is_dense(bool)
點雲數據中所有點均有值爲true,有inf/NaN爲false。
4、其他:sensor_origin_ (Eigen::Vector4f)、sensor_orientation_ (Eigen::Quaternionf)
這兩個通常是可選項,大部分算法用不到這兩個。
爲了簡化開發,點雲數據類包含許多幫助器成員函數。例如, 用戶不必在代碼中檢查高度是否等於1, 便可以查看數據集是否已組織, 而是使用:
if (!cloud.isOrganized ())
...