{"action":"created","issue":{"url":"https://api.github.com/repos/IntelVCL/Open3D/issues/359","repository_url":"https://api.github.com/repos/IntelVCL/Open3D","labels_url":"https://api.github.com/repos/IntelVCL/Open3D/issues/359/labels{/name}","comments_url":"https://api.github.com/repos/IntelVCL/Open3D/issues/359/comments","events_url":"https://api.github.com/repos/IntelVCL/Open3D/issues/359/events","html_url":"https://github.com/IntelVCL/Open3D/issues/359","id":323862106,"number":359,"title":"Different results between c++ and python","user":{"login":"longchao343","id":9880417,"avatar_url":"https://avatars0.githubusercontent.com/u/9880417?v=4","gravatar_id":"","url":"https://api.github.com/users/longchao343","html_url":"https://github.com/longchao343","followers_url":"https://api.github.com/users/longchao343/followers","following_url":"https://api.github.com/users/longchao343/following{/other_user}","gists_url":"https://api.github.com/users/longchao343/gists{/gist_id}","starred_url":"https://api.github.com/users/longchao343/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/longchao343/subscriptions","organizations_url":"https://api.github.com/users/longchao343/orgs","repos_url":"https://api.github.com/users/longchao343/repos","events_url":"https://api.github.com/users/longchao343/events{/privacy}","received_events_url":"https://api.github.com/users/longchao343/received_events","type":"User","site_admin":false},"labels":[{"id":493292420,"url":"https://api.github.com/repos/IntelVCL/Open3D/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-05-17T03:43:38Z","updated_at":"2018-05-17T05:40:55Z","closed_at":null,"author_association":"NONE","body":"Hi, I use Open3D RegistrationRANSACBasedOnFeatureMatching and FastGlobalRegistration api on my c++ project, but I found the results are not that stable. I also test the data using Open3D TestRegistrationRANSAC.cpp, the results are also bad. But when I test the data using python scripts,the results are stable and correct. Can you help me out? Thanks"},"comment":{"url":"https://api.github.com/repos/IntelVCL/Open3D/issues/comments/389750804","html_url":"https://github.com/IntelVCL/Open3D/issues/359#issuecomment-389750804","issue_url":"https://api.github.com/repos/IntelVCL/Open3D/issues/359","id":389750804,"user":{"login":"longchao343","id":9880417,"avatar_url":"https://avatars0.githubusercontent.com/u/9880417?v=4","gravatar_id":"","url":"https://api.github.com/users/longchao343","html_url":"https://github.com/longchao343","followers_url":"https://api.github.com/users/longchao343/followers","following_url":"https://api.github.com/users/longchao343/following{/other_user}","gists_url":"https://api.github.com/users/longchao343/gists{/gist_id}","starred_url":"https://api.github.com/users/longchao343/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/longchao343/subscriptions","organizations_url":"https://api.github.com/users/longchao343/orgs","repos_url":"https://api.github.com/users/longchao343/repos","events_url":"https://api.github.com/users/longchao343/events{/privacy}","received_events_url":"https://api.github.com/users/longchao343/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T05:40:55Z","updated_at":"2018-05-17T05:40:55Z","author_association":"NONE","body":"Here is my usage:\r\n`void RelativePoseIcpSolver::FPFHRoughPoseSolver(three::PointCloud& cloud0,three::PointCloud& cloud1,\r\n                         const Eigen::Matrix4d& init_pose,Eigen::Matrix4d& rela_pose,\r\n                         double& time,bool& converged,double& fitness_score,bool bCalcu_normal,bool buse_fast_reg)\r\n{\r\n    pcl::console::TicToc timer;\r\n    timer.tic();\r\n    //since pcl sac-ia implementation is rubish, we use implementation of zhouqianyi\r\n    //zhouqianyi's implementation seems very fast, so we use finner grid leaf size\r\n    //TODO: internal implement sac-ia\r\n    if(init_pose != Eigen::Matrix4d::Identity() && init_pose != Eigen::Matrix4d::Zero())\r\n        cloud0.Transform(init_pose);\r\n\r\n    auto prepareCloud = [&bCalcu_normal,this](const three::PointCloud& input,three::PointCloud& downspaled,shared_ptr<three::Feature>& features)\r\n    {\r\n        auto input_downsample_ptr = three::VoxelDownSample(input,param.fine_leaf_size);\r\n        downspaled = *input_downsample_ptr;\r\n        if(bCalcu_normal)\r\n        {\r\n            double normal_search_radius = param.fine_leaf_size * 2;\r\n            three::EstimateNormals(downspaled,three::KDTreeSearchParamHybrid(normal_search_radius,30));\r\n        }\r\n        double feature_search_radius = param.fine_leaf_size*5;\r\n        features = three::ComputeFPFHFeature(downspaled,three::KDTreeSearchParamHybrid(feature_search_radius,100));\r\n    };\r\n\r\n    three::PointCloud src,tgt;\r\n    shared_ptr<three::Feature> src_fpfh_feature,tgt_fpfh_feature;\r\n\r\n    prepareCloud(cloud0,src,src_fpfh_feature);\r\n    prepareCloud(cloud1,tgt,tgt_fpfh_feature);\r\n\r\n    //sac-ia or fast global registraion\r\n    three::RegistrationResult results;\r\n    if(buse_fast_reg)\r\n    {\r\n        three::FastGlobalRegistrationOption fast_regist_option;\r\n        fast_regist_option.maximum_correspondence_distance_ = param.fine_leaf_size * 0.5;\r\n        results = three::FastGlobalRegistration(src,tgt,*src_fpfh_feature,*tgt_fpfh_feature,fast_regist_option);\r\n    }\r\n    else\r\n    {\r\n        //TODO: stl ref_warpper seems cause error,tobe checked\r\n        double distance_thresh = param.fine_leaf_size * 1.5;\r\n        std::vector<std::reference_wrapper<const three::CorrespondenceChecker> >\r\n                correspondence_checker;\r\n        auto correspondence_checker_edge_length =\r\n                three::CorrespondenceCheckerBasedOnEdgeLength(0.9);\r\n        auto correspondence_checker_distance =\r\n                three::CorrespondenceCheckerBasedOnDistance(distance_thresh);\r\n\r\n        correspondence_checker.push_back(correspondence_checker_edge_length);\r\n        correspondence_checker.push_back(correspondence_checker_distance);\r\n\r\n        results = three::RegistrationRANSACBasedOnFeatureMatching(src,tgt,*src_fpfh_feature,*tgt_fpfh_feature,\r\n                                                                  distance_thresh,three::TransformationEstimationPointToPoint(false),\r\n                                                                    4, correspondence_checker,\r\n                                                                  three::RANSACConvergenceCriteria(4000000, 500));\r\n    }\r\n    //retrival pose\r\n    cout<<results.transformation_<<endl;\r\n    rela_pose = results.transformation_ * init_pose;\r\n    fitness_score = results.fitness_;\r\n    time = timer.toc();\r\n    //print ICP report\r\n    cout<<\"==============Open3D FPFH SAC-IA Report================\\n\"<<\r\n        \" time: \"<<time<<\"\\n converged: \"<<converged<<\"\\n fittness socre: \"<<fitness_score<<\r\n        \"\\n relative pose: \\n\"<<rela_pose<<\"\\n\";\r\n    cout<<\"==========================================\\n\";\r\n}`"}}
{"actor":{"display_login":"longchao343"}}