#include <iostream>
#include <string>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
int main(int argc, char** argv){
std::string file_path = "/home/..."
int remove_color = 255;
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
pcl::io::loadPCDFile<pcl::PointXYZRGB>(file_path, *cloud)
pcl::PointCloud<pcl::PointXYZRGB>::Ptr filtered_cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
for (int i=0; i<cloud->size(); i++){
pcl::PointXYZRGB point = cloud->points[i];
uint8_t r = point.r;
uint8_t g = point.g;
uint8_t b = point.b;
if (r != remove_color && g != remove_color && b!= remove_color){
filtered_cloud -> push_back(point);
}
}
pcl::io::savePCDFileASCII("/home/..", *filtered_cloud);
return 0;
}