29 labeledCloud.reset(
new pcl::PointCloud<pcl::PointXYZRGBL>());
32 pcl::PointCloud<pcl::PointXYZRGBL>::Ptr&
34 armarx::Blob segmentImage)
36 std::cout <<
" Input point cloud size: " << CloudPtr->points.size()
37 <<
" width: " << CloudPtr->width <<
" height: " << CloudPtr->height << std::endl;
38 std::cout <<
" segment mask size: " << segmentImage.size() << std::endl;
40 const int width = CloudPtr->width;
41 const int height = CloudPtr->height;
43 labeledCloud->resize(CloudPtr->points.size());
46 for (
int i = 0; i < height; i++)
48 for (
int j = 0; j < width; j++)
50 labeledCloud->points[i * width + j].x = CloudPtr->points[i * width + j].x;
51 labeledCloud->points[i * width + j].y = CloudPtr->points[i * width + j].y;
52 labeledCloud->points[i * width + j].z = CloudPtr->points[i * width + j].z;
53 labeledCloud->points[i * width + j].r = CloudPtr->points[i * width + j].r;
54 labeledCloud->points[i * width + j].g = CloudPtr->points[i * width + j].g;
55 labeledCloud->points[i * width + j].b = CloudPtr->points[i * width + j].b;
56 labeledCloud->points[i * width + j].label = segmentImage.at(i * width + j);
66 const int width = CloudPtr->width;
67 const int height = CloudPtr->height;
70 for (
int i = 0; i < height; i++)
72 for (
int j = 0; j < width; j++)
74 pcl::PointXYZRGBA& point = CloudPtr->at(i * width + j);
75 rgbImage.push_back(point.r);
76 rgbImage.push_back(point.g);
77 rgbImage.push_back(point.b);