-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ReLOC - Initial alignment algorithm #1614
base: master
Are you sure you want to change the base?
Add ReLOC - Initial alignment algorithm #1614
Conversation
The pull request has been rebased and all the fixes has been squashed. |
I've started looking into this. There's quite a lot of changes so it might take me some time to go through all of it. |
This PR is really complex! Would it make sense to subdivide it? For example
@SergioRAgostinho what do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just reviewed your first commit. Let's start the discussion with only these carry on from there.
using namespace pcl::io; | ||
using namespace pcl::registration; | ||
using namespace std; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all using namespace
. Just the symbols you need. You even use the fully qualified names after.
cout << "Load target" << endl; | ||
pcl::PointCloud<pcl::PointXYZ>::Ptr target (new pcl::PointCloud<pcl::PointXYZ>); | ||
|
||
if (pcl::io::loadPCDFile<pcl::PointXYZ> ("bun0.ply", *target) == -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You use loadPCDFile but then mention a ply. Fetch the path to the files from argv and make a comment on top saying that these file are available on pcl/tests
cout << "Load source" << endl; | ||
pcl::PointCloud<pcl::PointXYZ>::Ptr source (new pcl::PointCloud<pcl::PointXYZ>); | ||
|
||
if (pcl::io::loadPCDFile<pcl::PointXYZ> ("bun4.ply", *source) == -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
} | ||
|
||
//apply a translation to the target for better disambiguation of normal signs | ||
Eigen::Vector3f translation_target; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eigen supports a constructor in which you can initialize immediately all three values. Can be declared const.
translation_target[0] = 0; | ||
translation_target[1] = -0.3; | ||
translation_target[2] = 0.5; | ||
Eigen::Quaternionf rotation_target(0.0f, 0.0f, 0.0f, 0.0f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be declared const.
features/src/lrf_utils.cpp
Outdated
A (i, 1) = points (i, 1) - centroid.y (); | ||
A (i, 2) = points (i, 2) - centroid.z (); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const Eigen::Matrix<float, Eigen::Dynamic, 3> A (points.rowwise () - centroid.transpose ());
* Software License Agreement (BSD License) | ||
* | ||
* Point Cloud Library (PCL) - www.pointclouds.org | ||
* Copyright (c) 2010-2012, Willow Garage, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment on the copyright
using namespace pcl::test; | ||
using namespace pcl::io; | ||
using namespace std; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all using namespace
. Just apply using
to all symbols you actually use.
#include <gtest/gtest.h> | ||
#include <pcl/point_cloud.h> | ||
#include <pcl/pcl_tests.h> | ||
#include <pcl/features/normal_3d_omp.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need the normal one, not the omp enabled one.
PointCloud<Normal>::Ptr normals (new PointCloud<Normal> ()); | ||
PointCloud<ReferenceFrame> bunny_LRF; | ||
|
||
float meshRes = 0.005f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Const
@taketwo Agree with everything. |
This pull request has been automatically marked as stale because it hasn't had Come back whenever you have time. We look forward to your contribution. |
- Add FLARELocalReferenceFrameEstimation class - Add unit test for FLARELocalReferenceFrameEstimation class - Add LRF_utils.h - Add LRF_utils.cpp - Add directedOrthogonalAxis, projectPointOnPlane in lrf_utils - getAngleBetweenUnitVectors, randomOrthogonalAxis, normalDisambiguation and planeFitting methods of BOARDLocalReferenceFrameEstimation class moved to lrf_utils.hpp
Move HoughSpace3D class from recognition library to geometry package Add hough_space_3d.h in geometry package Add hough_space_3d.hpp in geometry package Motivation: As recognition library depends on registration library and HoughSpace3D in recognition library will be used by ReLOCInitialAlignment class in registration library, adding ReLOCInitialAlignment would create a circular dependency. Solution: Move HoughSpace3D to a lower level package, whereas Hough3DGrouping remains in recognition library.
Comment if (indices_->size () > input_->points.size ()) Constructor of SampleConsensusModel assumes that the number of matches is lesser than the number of points. This is not always true. For example, in the case a radius search or a k-nn search (with k>1) is applied.
…ute() initCompute() of registration class set correspondence_estimation_ and set target_cloud_updated_ to false. Such operations could be useless or even improper for the classes deriving from registration. Adding virtual solve the problem.
Detector of flat keypoints proposed in: Petrelli A., Di Stefano L., "Pairwise registration by local orientation cues", Computer Graphics Forum, 2015 and used by ReLOC initial alignment algorithm.
ReLOC is an initial alignment algorithm proposed in: Petrelli A., Di Stefano L., "Pairwise registration by local orientation cues", Computer Graphics Forum, 2015. Add ia_ReLOC.h Add ia_ReLOC.hpp Add ia_ReLOC.cpp Add test_ReLOC_ia.cpp
ReLOC is an initial alignment algorithm proposed in: Petrelli A., Di Stefano L., "Pairwise registration by local orientation cues", Computer Graphics Forum, 2015. Add doc\tutorials\content\images\registration\ReLOC.png Modify doc\tutorials\content\index.rst Add doc\tutorials\content\ReLOC.rst Add doc\tutorials\content\sources\ReLOC\CMakeLists.txt Add doc\tutorials\content\sources\ReLOC\ReLOC.cpp
Replace rand() with std::uniform_int_distribution<int> uniformRandomGenerator() so as to extract keypoints uniformly in clouds with more than RAND_MAX points.
84e45b5
to
76a26d2
Compare
This reverts commit 1224939. As FLARELocalReferenceFrameEstimation class has been already added by pull request PointCloudLibrary#1571
Replace tabs with spaces
Remove spaces and comments
Move extendBBox in geometry.h Move computeBBoxFromStddev in centroid.h and rename it as computeBBoxFromPointDistribution Replace the matching stage explained in the paper with a simpler radius search in the one-dimensional space of the FLARE signed distances.
Hi, |
👍 Thanks @aliosciapetrelli . It might take some time as usual, but we'll get to it eventually. |
This pull request has been automatically marked as stale because it hasn't had Come back whenever you have time. We look forward to your contribution. |
ReLOC is an initial alignment algorithm proposed in:
Petrelli A., Di Stefano L., "Pairwise registration by local orientation cues", Computer Graphics Forum, 2015.
It requires the FLARE method for the computation of repeatable reference frames. FLARE method is implemented by the FLARELocalReferenceFrameEstimation class proposed through the pull request #1571.
ReLOC requires also some changes of Hough Voting and RANSAC. Moreover, it introduces the FlatKeypoint detector.