PCL-Cpp (70%)
1. PassThrough
์ฝ๋๋ [์ด๊ณณ]์์ ๋ค์ด๋ก๋ ๊ฐ๋ฅํฉ๋๋ค. ์ํํ์ผ์ [tabletop.pcd]์ ์ฌ์ฉํ์์ต๋๋ค.
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/filters/passthrough.h>
//Filtering a PointCloud using a PassThrough filter
//http://pointclouds.org/documentation/tutorials/passthrough.php#passthrough
int
main (int argc, char** argv)
{
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZRGB>);
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud_filtered (new pcl::PointCloud<pcl::PointXYZRGB>);
// *.PCD ํ์ผ ์ฝ๊ธฐ (https://raw.githubusercontent.com/adioshun/gitBook_Tutorial_PCL/master/Beginner/sample/tabletop.pcd)
pcl::io::loadPCDFile<pcl::PointXYZRGB> ("tabletop.pcd", *cloud);
// ํฌ์ธํธ์ ์ถ๋ ฅ
std::cout << "Loaded :" << cloud->width * cloud->height << std::endl;
// ์ค๋ธ์ ํธ ์์ฑ
pcl::PassThrough<pcl::PointXYZRGB> pass;
pass.setInputCloud (cloud); //์
๋ ฅ
pass.setFilterFieldName ("z"); //์ ์ฉํ ์ขํ ์ถ (eg. Z์ถ)
pass.setFilterLimits (0.70, 1.5); //์ ์ฉํ ๊ฐ (์ต์, ์ต๋ ๊ฐ)
//pass.setFilterLimitsNegative (true); //์ ์ฉํ ๊ฐ ์ธ
pass.filter (*cloud_filtered); //ํํฐ ์ ์ฉ
// ํฌ์ธํธ์ ์ถ๋ ฅ
std::cout << "Filtered :" << cloud_filtered->width * cloud_filtered->height << std::endl;
// ์ ์ฅ
pcl::io::savePCDFile<pcl::PointXYZRGB>("tabletop_passthrough.pcd", *cloud_filtered); //Default binary mode save
return (0);
}์คํ & ๊ฒฐ๊ณผ
์๊ฐํ & ๊ฒฐ๊ณผ



์๋ณธ
๊ฒฐ๊ณผ
๊ฒฐ๊ณผ(Negative)
2. Conditional Outlier removal


์๋ณธ
๊ฒฐ๊ณผ
Last updated
Was this helpful?