Organized Point cloud
Posted: Tue Sep 09, 2014 3:41 pm
Hi,
first of all thank you for your beautiful application and beautiful codin too i m so glad working with this app. :D thank you again
secondly i m sorry if you answer this question before i couldnt find it in forum anyway!
i want add a filter to your qPcl plugin and i m new to pcl library too, however i use pcl 1.7 and i want create a organized point cloud from your cloud without success can you guid me to do this?,
this is my code for extracting edges:
and IntegralImageNormalEstimation get error input point cloud is not organized,
and if you can please tell the best way for finding label_indices match points in ccPointCloud ?
thanks in advancs
first of all thank you for your beautiful application and beautiful codin too i m so glad working with this app. :D thank you again
secondly i m sorry if you answer this question before i couldnt find it in forum anyway!
i want add a filter to your qPcl plugin and i m new to pcl library too, however i use pcl 1.7 and i want create a organized point cloud from your cloud without success can you guid me to do this?,
this is my code for extracting edges:
Code: Select all
ccPointCloud * cloud = getSelectedEntityAsCCPointCloud();
if (!cloud)
return -1;
//if we have normals delete them!
if (cloud->hasNormals())
cloud->unallocateNorms();
PCLCloud::Ptr out_cloud(new PCLCloud);
cc2smReader converter;
converter.setInputCloud(cloud);
int result = converter.getAsSM(*out_cloud);
if (result != 1)
{
return -31;
}
CloudPtr pcloud (new Cloud);
fromPCLPointCloud2 (*out_cloud, *pcloud);
pcl::PointCloud<pcl::Normal>::Ptr normal (new pcl::PointCloud<pcl::Normal>);
pcl::IntegralImageNormalEstimation<PointXYZRGBA, pcl::Normal> ne;
ne.setNormalEstimationMethod (ne.COVARIANCE_MATRIX);
ne.setNormalSmoothingSize (10.0f);
ne.setBorderPolicy (ne.BORDER_POLICY_MIRROR);
ne.setInputCloud (pcloud);
ne.compute (*normal);
//OrganizedEdgeBase<PointXYZRGBA, Label> oed;
//OrganizedEdgeFromRGB<PointXYZRGBA, Label> oed;
//OrganizedEdgeFromNormals<PointXYZRGBA, Normal, Label> oed;
OrganizedEdgeFromRGB<PointXYZRGBA, Label> oed;
oed.setInputNormals (normal);
oed.setInputCloud (pcloud);
oed.setDepthDisconThreshold (default_th_dd);
oed.setMaxSearchNeighbors (default_max_search);
oed.setEdgeType (oed.EDGELABEL_NAN_BOUNDARY | oed.EDGELABEL_OCCLUDING | oed.EDGELABEL_OCCLUDED | oed.EDGELABEL_HIGH_CURVATURE | oed.EDGELABEL_RGB_CANNY);
PointCloud<Label> labels;
std::vector<PointIndices> label_indices;
oed.compute (labels, label_indices);
// Make gray point clouds
for (size_t idx = 0; idx < pcloud->points.size (); idx++)
{
uint8_t gray = uint8_t ((pcloud->points[idx].r + pcloud->points[idx].g + pcloud->points[idx].b) / 3);
pcloud->points[idx].r = pcloud->points[idx].g = pcloud->points[idx].b = gray;
}
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr occluding_edges (new pcl::PointCloud<pcl::PointXYZRGBA>),
occluded_edges (new pcl::PointCloud<pcl::PointXYZRGBA>),
nan_boundary_edges (new pcl::PointCloud<pcl::PointXYZRGBA>),
high_curvature_edges (new pcl::PointCloud<pcl::PointXYZRGBA>),
rgb_edges (new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::copyPointCloud (*pcloud, label_indices[0].indices, *nan_boundary_edges);
pcl::copyPointCloud (*pcloud, label_indices[1].indices, *occluding_edges);
pcl::copyPointCloud (*pcloud, label_indices[2].indices, *occluded_edges);
pcl::copyPointCloud (*pcloud, label_indices[3].indices, *high_curvature_edges);
pcl::copyPointCloud (*pcloud, label_indices[4].indices, *rgb_edges);
and if you can please tell the best way for finding label_indices match points in ccPointCloud ?
thanks in advancs