最遠(yuǎn)點(diǎn)采樣(Farthest Point Sampling)
這里我們來(lái)單獨(dú)看一下調(diào)用代碼,這里可以看到PCL中支持直接調(diào)用farthest_sampling這個(gè)函數(shù)可以實(shí)現(xiàn)最遠(yuǎn)點(diǎn)采樣。
最遠(yuǎn)點(diǎn)采樣(Farthest Point Sampling)是一種非常常用的采樣算法,由于能夠保證對(duì)樣本的均勻采樣,被廣泛使用,像3D點(diǎn)云深度學(xué)習(xí)框架中的PointNet++對(duì)樣本點(diǎn)進(jìn)行FPS采樣再聚類作為感受野,3D目標(biāo)檢測(cè)網(wǎng)絡(luò)VoteNet對(duì)投票得到的散亂點(diǎn)進(jìn)行FPS采樣再進(jìn)行聚類,6D位姿估計(jì)算法PVN3D中用于選擇物體的8個(gè)特征點(diǎn)進(jìn)行投票并計(jì)算位姿。FPS算法原理:
1、輸入點(diǎn)云有N個(gè)點(diǎn),從點(diǎn)云中選取一個(gè)點(diǎn)P0作為起始點(diǎn),得到采樣點(diǎn)集合S={P0};
2、計(jì)算所有點(diǎn)到P0的距離,構(gòu)成N維數(shù)組L,從中選擇最大值對(duì)應(yīng)的點(diǎn)作為P1,更新采樣點(diǎn)集合S={P0,P1};
3、計(jì)算所有點(diǎn)到P1的距離,對(duì)于每一個(gè)點(diǎn)Pi,其距離P1的距離如果小于L[i],則更新L[i] = d(Pi, P1),因此,數(shù)組L中存儲(chǔ)的一直是每一個(gè)點(diǎn)到采樣點(diǎn)集合S的最近距離;
3、選取L中最大值對(duì)應(yīng)的點(diǎn)作為P2,更新采樣點(diǎn)集合S={P0,P1,P2};
4、重復(fù)2-4步,一直采樣到N’個(gè)目標(biāo)采樣點(diǎn)為止。
std::vector< pcl::PointCloud< pcl::PointXYZ >> input_point_clouds(1);
std::vector< pcl::PointCloud< pcl::PointXYZ >> output_point_clouds;
ASSERT_NE(pcl::io::loadPLYFile< pcl::PointXYZ >(STR(INPUT_POINT_CLOUD_PATH),
input_point_clouds[0]), -1) < < "Couldn't read file test point cloud file";
farthest_sampling::samplePointCloudsCuda(input_point_clouds, output_point_clouds, 4096);
boost::filesystem::path output_path = STR(OUTPUT_POINT_CLOUD_PATH);
if (output_path.has_parent_path() && !boost::filesystem::exists(output_path.parent_path()))
{
boost::filesystem::create_directories(output_path.parent_path());
}
pcl::io::savePLYFile(STR(OUTPUT_POINT_CLOUD_PATH), output_point_clouds[0]);
ASSERT_EQ(output_point_clouds[0].size(), 4096);
-
plc
+關(guān)注
關(guān)注
5016文章
13388瀏覽量
465416 -
函數(shù)
+關(guān)注
關(guān)注
3文章
4346瀏覽量
62974 -
采樣
+關(guān)注
關(guān)注
1文章
123瀏覽量
25617
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
當(dāng)PCL翻轉(zhuǎn)PCLATH不增加,PC中的這個(gè)翻轉(zhuǎn)不改變PCLATH位
關(guān)于232的NCL,PCL的疑問(wèn)
PCL6143運(yùn)動(dòng)控制器原理及應(yīng)用
系統(tǒng)辨識(shí)中最優(yōu)采樣間隔的確定
PCL電梯控制系統(tǒng)
車載自組網(wǎng)中最遠(yuǎn)轉(zhuǎn)發(fā)機(jī)制的可靠性改進(jìn)
Lane Tech HS PCL自動(dòng)燈開源
![Lane Tech HS <b class='flag-5'>PCL</b>自動(dòng)燈開源](https://file.elecfans.com/web1/M00/D9/4E/pIYBAF_1ac2Ac0EEAABDkS1IP1s689.png)
Lane Tech PCL房間通知器開源分享
![Lane Tech <b class='flag-5'>PCL</b>房間通知器開源分享](https://file.elecfans.com/web1/M00/D9/4E/pIYBAF_1ac2Ac0EEAABDkS1IP1s689.png)
在Ubuntu上編譯安裝pcl教程
PCL中基礎(chǔ)下采樣介紹
![<b class='flag-5'>PCL</b>中基礎(chǔ)下<b class='flag-5'>采樣</b>介紹](https://file1.elecfans.com/web2/M00/B1/AA/wKgZomVccQaAICRsAAGn1z4tI8w650.jpg)
PCL中法線空間采樣介紹
PCL泊松盤采樣具體流程
![<b class='flag-5'>PCL</b>泊松盤<b class='flag-5'>采樣</b>具體流程](https://file1.elecfans.com/web2/M00/AF/E7/wKgaomVceFCAZN-jAABTSiRj5QI367.jpg)
評(píng)論