RANSAC for Correspondence Outliers Rejection

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

RANSAC for Correspondence Outliers Rejection

CansenJIANG
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: RANSAC for Correspondence Outliers Rejection

saimanoj18
Others might help you if you provide what the error are 
 


On Monday, 24 March 2014 3:53 PM, CansenJIANG <[hidden email]> wrote:
Hi all,

currently, I found some correspondences between two 3D scenes, and I want to
get the rigid transformation matrix between them. However, since not all of
them are good matching pairs, I need to reject some of the outliers before
estimating the transformation. In this case, suppose that I have two point
pair lists, I would like to use the PCL function:
*pcl::registration::CorrespondenceRejectorSampleConsensus *

My code:
    std::vector<int> IdxInliers;
    pcl::registration::CorrespondenceRejectorSampleConsensus crsac;
    crsac.setInputSource(model_keypoints);
    crsac.setInputTarget(obj_keypoints);
    crsac.setInlierThreshold(0.01);
    crsac.setMaximumIterations(1000);
    crsac.getInliersIndices(IdxInliers);

However, there's some errors in my code, and I couldn't find any examples on
how to use this function, could anyone help me?

Thanks and regards,
Cansen



--
View this message in context: http://www.pcl-users.org/RANSAC-for-Correspondence-Outliers-Rejection-tp4033001.html
Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users



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

Re: RANSAC for Correspondence Outliers Rejection

CansenJIANG
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: RANSAC for Correspondence Outliers Rejection

saimanoj18
Hi,

crsac.setInlierThreshold(0.01);

Here, setInlierThreshold function is the threshold for the distance between the two correspondences. You have set it to 0.01m which is very small. Try setting to some value between 0.10 to 0.25. You can decide this parameter by knowingly approximately how far the correspondences are.
 
With all Good wishes,
Sai Manoj Prakhya


On Monday, 24 March 2014 5:25 PM, CansenJIANG <[hidden email]> wrote:
Hi Saimanoj,

Actually it's not exactly an error, but it returns no inliers whatever I
tune the inlier threshold. I always gives zero inliers. I don't know if I'm
using the correct feeding data or not because the keypoint-pairs are
scattering randomly in the scene. And I only have 18keypoint pairs. But to
estimate the transformation, I am supposed to just use 3 points, so I would
like to use the ransac to reject some outliers based on the transformation
errors.

That's my whole idea, could someone help?

Thank you very much!

Cansen



--
View this message in context: http://www.pcl-users.org/RANSAC-for-Correspondence-Outliers-Rejection-tp4033001p4033005.html

Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users



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

Re: RANSAC for Correspondence Outliers Rejection

andersgb1
In reply to this post by CansenJIANG
Hmm, this is a bit tricky, given that we haven't seen your data, and the keypoints you are selecting. 18 is certainly not a lot! If I had your problem, I would first of all try a huge number of iterations, just to see if Ransac can even find a model. If still not, you have a problem with the data, maybe because you have too scattered keypoints, maybe because you just don't have any correct point matches. Are you using features for point correspondence matching?


On 24 March 2014 10:24, CansenJIANG <[hidden email]> wrote:
Hi Saimanoj,

Actually it's not exactly an error, but it returns no inliers whatever I
tune the inlier threshold. I always gives zero inliers. I don't know if I'm
using the correct feeding data or not because the keypoint-pairs are
scattering randomly in the scene. And I only have 18keypoint pairs. But to
estimate the transformation, I am supposed to just use 3 points, so I would
like to use the ransac to reject some outliers based on the transformation
errors.

That's my whole idea, could someone help?

Thank you very much!

Cansen



--
View this message in context: http://www.pcl-users.org/RANSAC-for-Correspondence-Outliers-Rejection-tp4033001p4033005.html
Sent from the Point Cloud Library (PCL) Users mailing list mailing list archive at Nabble.com.
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


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

Re: RANSAC for Correspondence Outliers Rejection

reza_mtn2001
In reply to this post by CansenJIANG
Hi man.
I have a problem related to removing bad correspondence point by applying RANSAC. I saw that you had exactly the same Problem like me. can you please guide me how you figure the problem out?

Best regards,
Reza
Reply | Threaded
Open this post in threaded view
|

Re: RANSAC for Correspondence Outliers Rejection

Armita
This post was updated on .
In reply to this post by CansenJIANG
Hi CansenJIANG,
I faced with the same problem! I used PFH algorithm for finding correspondences between my two point clouds and I have found 77 feature correspondence keypoints but ransac doesn't remove any of these point as bad correspondences from my output !!! The distance column in my correspondence file is in range 70 to 180. I think it is in meter but I am not sure! Please let me know How did you solve your problem?

Armita S.
MSc. student
Department of Geodesy & Geoinformation Science Technology
Reply | Threaded
Open this post in threaded view
|

Re: RANSAC for Correspondence Outliers Rejection

Armita
In reply to this post by andersgb1
Hi andersgb1, I used feature for finding the correspondences keypoint. you know how can I remove the bad correspondences from my correspondence file?? I tried to use CorrespondenceRejectorFeatures like this:

pcl::registration::CorrespondenceRejectorFeatures rejector;
        rejector.setSourceFeature<pcl::PFHSignature125>(source_descriptors,"pfh_source");
        rejector.setTargetFeature<pcl::PFHSignature125>(target_descriptors,"pfh_target");
        rejector.setInputCorrespondences(correspondences_out);
        rejector.getCorrespondences(*correspondences_out);

but as you can see it doesn't have any Threshold so I think it can't remove bad correspondences from my correspondence file, so I tried to use CorrespondenceRejectorSampleConsensus like :

rejector.setInputCloud(source_Keypoints);
    rejector.setTargetCloud(target_Keypoints);
    rejector.setMaxIterations(100);
    rejector.setInlierThreshold(inlierThreshold);
    rejector.setInputCorrespondences(correspondences);
    rejector.getCorrespondences(*correspondences);

but it doesn't remove any bad correspondences from my source and target as well. I don't know where is the problem or which kind of parameters should be changed!! in Ransac I am not sure that do I really need to add setInputCorrespondences to my function?? if yes, which information should be stored on it ?


Armita S.
MSc. student
Department of Geodesy & Geoinformation Science Technology
Reply | Threaded
Open this post in threaded view
|

Re: RANSAC for Correspondence Outliers Rejection

Jue_KA
Armita,

have you solved your problem? If yes how?

best regards



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users