PCL程式設計-法向量計算
【原文:http://blog.csdn.net/q597967420/article/details/12220865】
NormalEstimation:PCL中計演算法向量的類。原理是通過對鄰域點集求PCA來得到法向量。對領域點的三維座標進行中心化,求得協方差矩陣並對角化,求得三個特徵值,最小特徵值對應的特徵向量就是法向量。
包含的庫:
- #include <pcl/features/normal_3d.h>
- NormalEstimation<PointXYZRGBA, Normal> normObj; //建立法向量計算物件
- normObj.setInputCloud (cloud); //設定輸入點雲
- //search::OrganizedNeighbor<PointXYZRGBA>::Ptr tree(new search::OrganizedNeighbor<PointXYZRGBA>());
- search::KdTree<PointXYZRGBA>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZRGBA> ());
- normObj.setSearchMethod (tree); //設定搜尋方法
- normObj.setRadiusSearch (0.05); //設定半徑鄰域搜尋
- //normObj.setKSearch(30); //設定K鄰域搜尋
- PointCloud<Normal>::Ptr normals (new PointCloud<Normal>); //建立法向量點雲
- normObj.compute (*normals); //計演算法向量
Organized點雲(有序點雲)是由深度圖轉換過來的,一個畫素格對應一個點,類似於二維的影象,由Kinect採集到的點雲就是有序點雲。對於有序點雲,可以用IntegralImageNormalEstimation更快速的計演算法向量。
演算法原理參考:Dirk Holz. Real-Time Plane Segmentation Using RGB-D Cameras
包含庫:
- #include <pcl/features/integral_image_normal.h>
使用方法:
- PointCloud<Normal>::Ptr normals (new pcl::PointCloud<Normal>);
- normals->width = cloud->width;normals->height=cloud->height;normals->resize(normals->width*normals->height);
- IntegralImageNormalEstimation<PointXYZRGBA, Normal> ne;
- ne.setNormalEstimationMethod (ne.AVERAGE_3D_GRADIENT);
- /*COVARIANCE_MATRIX - creates 9 integral images to compute the normal for a specific point from the covariance matrix of its local neighborhood.
- AVERAGE_3D_GRADIENT - creates 6 integral images to compute smoothed versions of horizontal and vertical 3D gradients and computes the normals using the cross-product between these two gradients.
- AVERAGE_DEPTH_CHANGE - creates only a single integral image and computes the normals from the average depth changes.*/
- ne.setMaxDepthChangeFactor(0.01f);
- ne.setNormalSmoothingSize(10.0f);
- ne.setInputCloud(cloud);
- ne.compute(*normals);
對比:
PCA計算得到的法向量,精度高,但是耗時太大,對於640*480的點雲,耗時近10S,就算改用有序鄰域搜素,仍然要5S。無法滿足實時性要求。
積分圖計演算法向量,實際上就是二個切向量叉乘,精度很差,就算通過平滑,效果仍然比不上PCA,但時間快速,640*480的點雲,耗時不超過200ms。適用於實時性高的場合。
相關文章
- 向量點積計算javaJava
- PCL 計算點雲的面積和體積
- cuda程式設計與gpu平行計算(四):cuda程式設計模型程式設計GPU模型
- TGDC | 一個遊戲程式設計師的堅持 —— 論向量化程式設計遊戲程式設計師
- 程式設計師的計算機配置程式設計師計算機
- 計算機程式設計心得總結計算機程式設計
- 10 早期計算機如何程式設計計算機程式設計
- 2024 計算導論與程式設計程式設計
- 好程式設計師雲端計算教程分享if巢狀功能語法解析程式設計師巢狀
- 01 Python3程式設計之程式設計語法簡介Python程式設計
- MPI矩陣向量乘法程式碼《並行程式設計導論》矩陣並行行程程式設計
- 向量圖設計?Affinity Designer for MacMac
- 世界五大計算機程式設計師計算機程式設計師
- 計算機課程程式設計經驗分享計算機程式設計
- Java程式設計常用計算機小知識Java程式設計計算機
- 程式設計必備基礎 計算機組成原理+作業系統+計算機網路,計算機基礎——更適合程式設計師的程式設計必備基礎知識作業系統計算機網路程式設計師
- 好程式設計師雲端計算教程分享Shell程式設計之for迴圈結構程式設計師
- 28、(向量)歐幾里得距離計算
- R語言程式設計藝術 第2章 向量(上)R語言程式設計
- 《計算機程式設計藝術》作者高德納計算機程式設計
- 《自然》:如何更有效學習計算機程式設計?計算機程式設計
- 向量圖形設計Illustrator 2022(AI)AI
- 結對程式設計-四則運算程式設計
- 程式設計技巧之-表驅動法程式設計
- 程式設計師的4條說法程式設計師
- ios程式設計師提高程式設計能力萬無一失的辦法iOS程式設計師
- SEHH2042計算機程式設計集團專案計算機程式設計
- Contravariance 概念在計算機程式設計中的應用計算機程式設計
- 程式設計師計算私活薪資的正確方式程式設計師
- 學習計算機程式設計需要什麼基礎?計算機程式設計
- 網路程式設計-計算機網路三要素程式設計計算機網路
- 2024-2025-3-計算機基礎與程式設計計算機程式設計
- HUST-計算機網路實驗-socket程式設計計算機網路程式設計
- python ubuntu lib7 -計算人臉特徵向量PythonUbuntu特徵
- 資料庫-SQL_duckdb向量化計算-vector資料庫SQL
- Sketch 向量繪圖UI設計軟體繪圖UI
- cdr2021 向量圖形設計工具
- word2vec實現域名向量化並計算相似度-python程式碼Python
- 學習筆記 -《量子計算與程式設計入門》- 量子計算機硬體基礎筆記程式設計計算機