學習PCL心得體會——結構點雲(Organized PointClouds)


有在學習PCL的朋友們,或多或少會接觸到結構點雲(Organized PointClouds)。

結構點雲的定義

什么是結構點雲?下面引用PCL官網的一段解釋。

1 結構點雲:An organized point cloud dataset is the name given to point clouds that resemble

an organized image (or matrix) like structure, where the data is split into rows and columns.

也就是說,像平常的照片一樣,有行列順序的點雲,叫結構點雲。

例如:

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

結構點雲的重要性

由Kinect等支持OpenNI接口的相機獲取的點雲為結構點雲,但是結構點雲經過某些人為操作后,會變為無結構點雲,比如濾波操作等。

而PCL算法庫里面的某些重要算法,僅支持結構點雲,比如多平米分割算法(OrganizedMultiPlaneSegmentation)。

想必有不少朋友遇到過這樣的問題:

[pcl::IntegralImageNormalEstimation::setInputCloud] Input dataset is not organized (height=1).

下面,我們以直通濾波為例,解釋如何讓結構點雲經過操作之后,仍為結構點雲。閑話不多說,直接上代碼:

pcl::PassThrough<pcl::PointXYZ> pass;
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud1(new pcl::PointCloud<pcl::PointXYZ>);
pass.setInputCloud(cloud);
pass.setFilterFieldName("z");
pass.setFilterLimits(0.4, 0.94);
pass.setKeepOrganized(true);
pass.filter(*cloud1);

我們只需要在進行濾波的時候,將點雲設置為KeepOrganized即可,也就是pass.setKeepOrganized(true);這條語句。

下面附上一幅OrganizedMultiPlaneSegmentation的效果圖,祝大家學習愉快!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM