Skip to content

Add OpenGR wrapper#3477

Closed
sloriot wants to merge 14 commits intoCGAL:masterfrom
sloriot:OpenGR_wrapper
Closed

Add OpenGR wrapper#3477
sloriot wants to merge 14 commits intoCGAL:masterfrom
sloriot:OpenGR_wrapper

Conversation

@sloriot
Copy link
Copy Markdown
Member

@sloriot sloriot commented Nov 25, 2018

Add a CGAL wrapper to OpenGR providing methods for registering point clouds.

cc @nmellado

TODO:

  • get rid of FindOpenGR.cmake
  • small feature
  • add support for other registration methods (through named parameters?)
  • add interface to other functions (compute_transformation(), ...)
  • check potential issue of compiling OpenGR library with a given version of Eigen and using CGAL with another version of Eigen.

@sloriot
Copy link
Copy Markdown
Member Author

sloriot commented Nov 25, 2018

@nmellado I think it would make think simpler on the cmake side for CGAL if when building OpenGR in addition to generated/OpenGRConfig.cmake (that is generated for the purpose of make install IIUC) you also generate a OpenCRConfig.cmake directly in the build directory that enables anyone to use the current build directory.

Basically, this means making a copy of libs in a lib directory in the build dir and updating

set(OpenGR_INCLUDE_DIR "/usr/local/include/")
set(OpenGR_LIB_DIR "/usr/local/lib/")
set(OpenGR_LIBRARIES opengr_accel opengr_io opengr_algo)

using ${CMAKE_SOURCE_DIR}/src and ${CMAKE_BUILD_DIR}/lib for exemple.

@afabri
Copy link
Copy Markdown
Member

afabri commented Nov 26, 2018

Do we really have to copy the points?

@nmellado
Copy link
Copy Markdown

Thanks @sloriot for preparing this PR.
This remind me I've still not merged my OpenGR branch with the stable API (STORM-IRIT/OpenGR#13)

I've just started, I've a couple of things to fix but will try to do it today.

@afabri I have to improve a bit the OpenGR API so points does not need to be copied from CGal. But as discussed with @sloriot, we can first try with the current version where points are copied.

@nmellado
Copy link
Copy Markdown

@sloriot FYI the new API have been merged in master, I will try to update this code tomorrow accordingly.

@sloriot
Copy link
Copy Markdown
Member Author

sloriot commented Nov 29, 2018

@nmellado I did the update.

@sloriot
Copy link
Copy Markdown
Member Author

sloriot commented Nov 29, 2018

@nmellado I created STORM-IRIT/OpenGR#15 that allows me to remove FindOpenGR.cmake from this branch.

@nmellado
Copy link
Copy Markdown

Regarding this point:

check potential issue of compiling OpenGR library with a given version of Eigen and using CGAL with another version of Eigen.
Having OpenGR as header only would solve this. RIght now OpenGR is header only, except the io package.

One solution would be to add package components to OpenGR, i.e. having one component per target that exists today.
Thus you could do something:

find_package(OpenGR COMPONENTS algo accel utils )

Of course this would also require an option in OpenGR to build the library (ie. generate the cmake package) without compiling IO.

Sounds good to you ?

@sloriot
Copy link
Copy Markdown
Member Author

sloriot commented Nov 30, 2018

Right now it just does not link with the IO lib. So it is probably no longer an issue.

@nmellado
Copy link
Copy Markdown

Fair enough.

@sloriot
Copy link
Copy Markdown
Member Author

sloriot commented Dec 4, 2018

@nmellado does it make sense to offer an interface to another method than super4PCS for now?
Could you point me to the documentation of the options?

@nmellado
Copy link
Copy Markdown

nmellado commented Dec 6, 2018

We can stick to Super4PCS now, the other approaches might need more testing.
Supporting 4PCS should come at no cost however.

Parameter setting is described here: https://storm-irit.github.io/OpenGR/a00012.html

@sloriot
Copy link
Copy Markdown
Member Author

sloriot commented Dec 7, 2018

From what I see there are only 3 parameters. @sgiraudot what do you think? shall we pass the option struct or shall we add new named parameters (provided that I already added one to pass the options, it means that we'd need to only add two new). I think I'm in favor of adding new named parameters except if @nmellado says that the options are not stable and more might be added.
@nmellado About the documentation of the parameters, are you OK if we somehow copy/paste your doc?

@sgiraudot
Copy link
Copy Markdown
Contributor

I'm also in favor of adding new parameters, especially because they can be re-used by other algorithms (something like accuracy is general enough to have another usage somewhere else later on). Which wouldn't be the case with the option struct. Also NP is already a quite complex/flexible way to handle parameters, using them to carry a struct of several parameters seems like adding an unnecessary layer of complexity.

By the way, we could already thinking of recycling some existing named parameters, for example number_of_output_points could be renamed number_of_samples, be also used for OpenGR and be documented more generally in the NP page (and more specifically on the functions that use it).

@nmellado
Copy link
Copy Markdown

nmellado commented Dec 7, 2018

@sloriot it's ok you can copy/paste the doc, and link to the OpengGR version, in case I update it.

The parameters are stables and should not move that much.
Actually, there is no any parameters that is specific to Super4PCS itself:

  • Overlap: specific to RANSAC-based algorithms (e.g. 3PCS, (Super)4PCS). Other kinds of algorithms might use similar parameter to sub-sample the input clouds.
  • Number of samples: related to the sub-sampling stage. Note that for CGAL's wrapper, we could skip this step and assume the user gives a subsampled point cloud, obtained by CGAL algorithms. It is maybe more generic and powerful than using the simple quantification approach used in current version of OpenGR.
  • Registration accuracy: related to the alignment metric. This metric could be used in other contexts (to compute distances between models) or may be replaced by another metric.
    Note: this is potential change for next release of OpenGR, where the metric can be changed (e.g. set as a template parameter of the registration method).

@lrineau lrineau added Conflicts rm: not for next release Indicate to the release team that a PR should not be merged before the next release branch is forked labels Jan 7, 2019
@lrineau lrineau added this to the 4.15-beta milestone Jan 7, 2019
CGAL_add_named_parameter(number_of_samples_t, number_of_samples, number_of_samples)
CGAL_add_named_parameter(accuracy_t, accuracy, accuracy)
CGAL_add_named_parameter(maximum_running_time_t, maximum_running_time, maximum_running_time)
CGAL_add_named_parameter(overlap_t, overlap, overlap)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new parameters should be tested in test_cgal_bgl_named_params.cpp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct, I'll do it.

assert(get_param(np, CGAL::internal_np::face_normal).v == 36);
assert(get_param(np, CGAL::internal_np::random_seed).v == 37);
assert(get_param(np, CGAL::internal_np::do_project).v == 38);
assert(get_param(np, CGAL::internal_np::opengr_options).v == 9001);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one no longer exists

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the test with the new NP and remove this one.


\subsection thirdpartyOpenGR OpenGR

\sc{OpenGR} is a is a set C++ libraries for 3D Global Registration released under the terms of the APACHE V2 licence.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: is a is

\cgalCite{cgal:mam-sffgp-14};

- `CGAL::OpenGR::register_point_sets()` computes the registration of
one point set w.r.t. another and directly aligns it to it.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aligns them?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds better, yes.


\return the registration score.
*/
template <class PointRange1, class PointRange2,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of removing all the doc and point to the function computing the transformation matrix + saying that the transformation is applied to all the points from the second set?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good idea, avoiding duplicating the full documentation of the function.

@maxGimeno
Copy link
Copy Markdown
Contributor

Travis report : In file included from /home/travis/build/CGAL/cgal/Installation/../Point_set_processing_3/include/CGAL/OpenGR/register_point_sets.h:31:
/home/travis/build/CGAL/cgal/Point_set_processing_3/include/CGAL/OpenGR/compute_registration_transformation.h:33:10: fatal error: 'gr/algorithms/FunctorSuper4pcs.h' file not found
#include <gr/algorithms/FunctorSuper4pcs.h>
^

@lrineau lrineau added Tests failing and removed Conflicts rm: not for next release Indicate to the release team that a PR should not be merged before the next release branch is forked labels Jan 21, 2019
@lrineau
Copy link
Copy Markdown
Member

lrineau commented Jun 3, 2019

@sloriot You asked this morning about this pull-request. It is stalled:

  • waiting for small feature page, and that is probably what blocked it at the first time,
  • Travis tests did not pass,
  • there is a conflict with master.

@sloriot
Copy link
Copy Markdown
Member Author

sloriot commented Aug 19, 2019

Replaced by #4153

@sloriot sloriot closed this Aug 19, 2019
@MaelRL MaelRL modified the milestones: 5.1-beta, Trash / Attic Aug 19, 2019
@sloriot sloriot deleted the OpenGR_wrapper branch July 1, 2020 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants