-
-
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
4pcs registration method ... #976
Conversation
8cf1f0f
to
e7959af
Compare
Hi, thanks for contributing! Could you please explain in greater detail how this pull request is related with #726? Is this supposed to replace it? Was the code copied or derived from that contribution? |
Hi Sergey Sadly, it is absolutely independent of #726 and it probably has a quite large overlap. I had the following reasons to anyway contribute my code:
I hope this clarifies things |
Pascal, thanks for the detailed explanation. I think we should adopt your contribution since a) it is more complete and feature-rich; b) the author of the other one does not reply to our comments anyways. I skimmed through the code already and I think it is in a good shape, though I had several questions here and there. But before we go into details, I would like to ask you to split this pull request in two parts (original and keypoint-based method) so it is easier to review and merge. Also we will need a few unit tests for 4PCS/K4PCS. |
Sergey, I split up the two pull requests. Although it was a little confusing to do this and it has to be mentioned, that the other request only works if this one has already been merged, because k-4pcs inherits a lot for 4pcs and also uses the transformation estimation based on 3 points... |
Sergey probably meant you should split this pull request into multiple (logical) commits; not split the pull request into multiple pull requests 😉 For example the first commit adds a class, the second commits adds tests for the first class etc.. |
No no, I actually meant multiple pull requests. When a request adds/changes 3k+ lines it is hard to review and discuss it, as well as to say "yes" in the end and merge.
Sure, I understand this. We'll simply forget about the second one until the first one is merged. |
Not sure now, is it fine like that or not? Splitting up the commit itself will be quite hard, because there are no changes to existing code which I could split but rather a complete new feature. About the unit tests: because this is my first contribution to such a project, I don't know what unit tests are. Please help me out here. What exactly do you need? |
It's fine. I will review the code and leave inline comments. Unfortunately I am quite busy with other things now, so maybe I will only have time to dig into this next week.
We need a small test program that would instantiate your class, setup it's parameters, feed it some input, and verify that the output is as expected. Just have a look inside |
I already have a simple test program based on a small data set (2 x ply-files, 250kb), but I'm struggling with implementing this in the gtest environment to get a functioning unit test. Any help would be appreciated, but it may be the easiest solution if I just commit the unit test (cpp file and header with method parameters), although I can not test it on my computer and it may not run like it is now. Or are there any other suggestions? |
If you have concrete questions or problems please don't hesitate to ask. |
Sergey, before you go too much into coding detail, I just realized (during setting up the unit test, which by the way should soon work) that the complete method should be moved to a registration method thus inheriting from the registration base class rather than from correspondence estimation one. The goal of the method is comparable to the SAC-IA which is also placed there. Do you agree? I did some checks and realized that the transfer is not too complicated and I should be able to do it by tomorrow. I would then update the commits. I have just one question since the base class of registration provides a lot of setter and getter methods for protected member which are not needed in 4pcs, do I have to overwrite them with PCL_DEPRECATED return info or can I just ignore them? Cheers |
/** \brief The number of points to uniformly sample the source point cloud. (standard = 0 => full cloud). */ | ||
int nr_samples_; | ||
|
||
/** \brief Maximum normal difference of corresponding point pairs (standard = 90�). */ |
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.
Looks like an encoding problem?
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 don't get the point here, can you clarify what you mean?
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.
Github is showing only a question mark, so I guess it's not ASCII.
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.
oh yeah, it was just a degree symbol. I have replaced it with the actual word "degree"
Looks like a nice contribution, thanks! Back when we planned the registration module, we discussed breaking the API into estimators, matches, and so on (see http://pointclouds.org/documentation/tutorials/registration_api.php). Wouldn't it make sense to do the same here? I know it would be a lot of work, just asking. |
* Software License Agreement (BSD License) | ||
* | ||
* Point Cloud Library (PCL) - www.pointclouds.org | ||
* Copyright (c) 2010-2011, 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.
Please drop Willow Garage, they have nothing to do with the code.
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 will drop that one, must have been an old copy of the license agreement
@jspricke The question about splitting up the method into a correspondence estimation and a matching part is not easy to answer, especially because personally, I consider these two things unseperable. In case of 4pcs, I think it is too strongly connected. I even had placed the method first in the area of correspondence estimation (worked also quite well), but then again it already solves the matching and provides the result of the initial alignment between source<->target. Consider the following situation: Given a base set of four points, the method searches for a congruent 4 point set in the target cloud. This step could be considered as a correspondence estimation method, but the result is not a single set of correspondences but rather a series of possible 4 point matches, which have to be further evaluated. This is done by deriving for each possible match the resulting transformation parameters and calculating the resulting overlap between the source and target (or in case of k-4pcs an extended evaluation criteria). Thus to be able to return the "correct" (or most probable) correspondences, one already has to carry out the actual matching and gets the initial alignment in return. In conclusion, I would keep it as an unseperated, single method and place it at the same level as the initial aligment method of rusu (SampleConsenusInitialAlignment). |
280968d
to
2a62e32
Compare
Leaving it all in one class sounds fine then, thanks for clearing that up. |
transformation (Eigen::Matrix4f::Identity ()) {}; | ||
|
||
/** \brief Value constructor. */ | ||
Candidate (float s, pcl::Correspondences c, Eigen::Matrix4f m) : |
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.
Do not pass Eigen structures by value. Here const&
shoud be used.
Actually, this also counts for the correspondences argument, because that is an STL vector.
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.
The argument constructor was a left-over from previous versions, thats why I didn't check that, but since it may be useful, I keep it and replaced the arguments with const & (except of course the float argument).
2b48da2
to
0d41e05
Compare
Hi Pascal, thanks for polishing up the contribution. I think it is in a great shape now. @jspricke please merge if you have no further comments. Speaking about doxygen warnings... they are not critical of course. And it's true that the existing code produces tons of them. But I can understand Victor in his attempts to prevent new warnings from being introduced, considering that he has invested quite some effort in cleaning them up some time ago. Personally, I have similar feeling against compiler warnings, which I also fought before. |
It's not forbidden to do better than what the others have done 😉 Here are the last warnings:
If you want to test the doc, use this doxy file
|
Of course not :-). I will correct the warnings regarding the method parameters a.s.a.p. Considering the typedefs, do they also need a documentation? Are there any PCL classes, where I can find examples? (I don't wont the reinvent the wheel ;-)) |
Yes if you want to silent warnings, I usually do: (The typedefs don't really need to be explained IMO) It leads to a lot of useless lines though.
I think it's the best option |
Perhaps doxygen has a global setting for that? |
Looks like no: http://www.stack.nl/~dimitri/doxygen/manual/config.html |
Allright, I have updated the doxy comments. Can you please recheck if there are remaining warnings? |
That's a perfect 👍 |
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* $Id: ia_fpcs.h 2014 P.W.Theiler$ |
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.
picky mode this could be removed.
Corrections applied. Anything else? I will squash all the commits before merging, but keep them for the moment until fine polishing is finished. |
👍 Thanks for the work! |
👍 for me |
👍 |
75a3872
to
391e353
Compare
@theilerp your pull request introduces a compiling error with clang, can you fix it? |
Since this pull request is already closed, I opened up a new one for bugfixes (#1089) |
@theilerp other compiling errors: I'll tell him to update his copy and try again. |
Might seem like a dumb question but how come this code is compiled, it's not referenced in any CMake file?! Even if it's compiled, it's not installed, so it's not very useful 😄 |
This is not compiled in the normal build, only when the tests are enabled, because the corresponding test includes the headers. Of course, goes without saying, this contribution is useless without install instructions :D I'll send a pull request. |
Oh crab, sorry, that was clearly my mistake. Thanks for cleaning it up... |
...as proposed by Aiger et al. (2007, 4-Points Congruent Sets for Robust Surface Registration) and Theiler et al. (2014, Keypoint-based 4-Points Congruent Sets – Automated marker-less registration of laser scans).
Commit is together with a fast transformation estimation method to speed up the calculation using a minimum number of 3 points. This method simplifies the calculation of transformation parameters when dealing with a 3 point planar case.
I do realize, that a comparable contribution (fpcs by stheg) was done in June 2014, but since the additional method k-4pcs is inheriting a lot from its parent 4pcs, this commitment is only useful in combination.