CorrespondenceEstimation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

CorrespondenceEstimation

gpicchiarelli
   I'm trying to get something to score differences between two pcd,
here I saved Narf descriptor for every scan and then I retrieve it with
loadPCDfile. But correspondences.size it is always the same. Where am I
wrong?

    PointCloud<Narf36> nd1,nd2;
    string h1 =
(this->__directory)+"3d_descriptors/"+boost::lexical_cast<string>(src_p);
    string h2 =
(this->__directory)+"3d_descriptors/"+boost::lexical_cast<string>(dst_p);
    pcl::io::loadPCDFile(h1.c_str(),nd1);
    pcl::io::loadPCDFile(h2.c_str(),nd2);
   
    PointCloud<Narf36>::ConstPtr input_cloud_ptr = nd1.makeShared() ;
    PointCloud<Narf36>::ConstPtr target_cloud_ptr = nd2.makeShared() ;

    pcl::Correspondences correspondences;
    pcl::registration::CorrespondenceEstimation<pcl::Narf36, pcl::Narf36
> CE ;
    CE.setInputTarget(target_cloud_ptr) ;
    CE.setPointRepresentation(boost::make_shared<NARFPointRepresenation>());
    CE.setInputCloud(input_cloud_ptr) ;

    CE.determineCorrespondences(correspondences);
   
    return correspondences.size();  

--
Giacomo Picchiarelli

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: CorrespondenceEstimation

aichim
Administrator
Hi

CorrespondenceEstimation will always give you a target pair for each source point. You can filter the correspondences by using a combination of the CorrespondenceRejection classes.

Cheers,
Alex

On Apr 12, 2013, at 11:25 AM, Giacomo Picchiarelli <[hidden email]> wrote:

>   I'm trying to get something to score differences between two pcd,
> here I saved Narf descriptor for every scan and then I retrieve it with
> loadPCDfile. But correspondences.size it is always the same. Where am I
> wrong?
>
>    PointCloud<Narf36> nd1,nd2;
>    string h1 =
> (this->__directory)+"3d_descriptors/"+boost::lexical_cast<string>(src_p);
>    string h2 =
> (this->__directory)+"3d_descriptors/"+boost::lexical_cast<string>(dst_p);
>    pcl::io::loadPCDFile(h1.c_str(),nd1);
>    pcl::io::loadPCDFile(h2.c_str(),nd2);
>
>    PointCloud<Narf36>::ConstPtr input_cloud_ptr = nd1.makeShared() ;
>    PointCloud<Narf36>::ConstPtr target_cloud_ptr = nd2.makeShared() ;
>
>    pcl::Correspondences correspondences;
>    pcl::registration::CorrespondenceEstimation<pcl::Narf36, pcl::Narf36
>> CE ;
>    CE.setInputTarget(target_cloud_ptr) ;
>    CE.setPointRepresentation(boost::make_shared<NARFPointRepresenation>());
>    CE.setInputCloud(input_cloud_ptr) ;
>
>    CE.determineCorrespondences(correspondences);
>
>    return correspondences.size();  
>
> --
> Giacomo Picchiarelli
>
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users