PointXYZRGB to CIELab conversion
I get this error:
/home/dinesh/catkin_ws_pcl/src/my_pcl_tutorial/src/godgift.cpp:48:41: error: no matching function for call to ‘pcl::NormalEstimation<pcl::PointXYZRGB, pcl::Normal>::setInputCloud(pcl::PointCloud<pcl::PointXYZRGB>&)’
normalEstimation.setInputCloud(output);
when i try to run below code:
void
cloud_cb (const sensor_msgs::PointCloud2ConstPtr& input)
{
pcl::PointCloud<pcl::PointXYZRGB> output;
pcl::fromROSMsg(*input,output);
pcl::PointCloud<pcl::Normal>::Ptr normals;
pcl::PointCloud<pcl::SHOT1344>::Ptr descriptors;
pcl::PointXYZRGB p[400][400];
for(int i=0;i<400;i++)
{
for(int j=0;j<400;j++)
{
p[i][j] = output.at(i,j);
}
}
pcl::NormalEstimation<pcl::PointXYZRGB, pcl::Normal> normalEstimation;
normalEstimation.setInputCloud(output);
normalEstimation.setRadiusSearch(0.03);
pcl::search::KdTree<pcl::PointXYZRGB>::Ptr kdtree;
normalEstimation.setSearchMethod(kdtree);
normalEstimation.compute(*normals);
pcl::SHOTColorEstimation<pcl::PointXYZRGB, pcl::Normal, pcl::SHOT1344> shot;
shot.setInputCloud(output);
shot.setInputNormals(normals);
shot.setRadiusSearch(0.02);
shot.compute(*descriptors);
std::cout<<"rgb"<<"\t"<<p[200][200].x<<"\t"<<p[200][200].r<<std::endl;
}
which i got from pcl forum but, i dont understand how do i use this. I want to somehow access lab values of color instead of rgb. Im using ros indigo, this are for the computer vision purpose. I also tried this methode but the values only comes zero.
pcl::PointCloud<pcl::PointXYZRGB> output;
pcl::fromROSMsg(*input,output);
pcl::PointCloud<pcl::PointXYZLAB> cloud;
pcl::copyPointCloud(output,cloud);
pcl::PointXYZLAB p;
p = output.at(400,300);
std::cout<<p.L<<"\t"<<p.a<<"\t"<<p.b<<std::endl;
I'm inclined to refer you to the PCL support forum
pcl-users.org
, as this is a rather PCL-specific question. You probably stand a better chance of getting answers there.i have posted question their also, to get solution of the problem as fast as it is possible. but no ans till now.