isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.35k stars 2.29k forks source link

Registration based on correspondences fails with Type Error #1655

Closed oafolabi closed 2 years ago

oafolabi commented 4 years ago

Describe the bug I tried using open3d's python api to perform registration using correspondences, given two pointclouds and a Vector2iVector of correspondences. It failed and returned the error below:

TypeError: registration_ransac_based_on_correspondence(): incompatible function arguments. The following argument types are supported:

  1. (source: open3d.open3d.geometry.PointCloud, target: open3d.open3d.geometry.PointCloud, corres: open3d.open3d.utility.Vector2iVector, max_correspondence_distance: float, estimation_method: open3d.open3d.registration.TransformationEstimation = registration::TransformationEstimationPointToPoint without scaling., ransac_n: int = 6, criteria: open3d.open3d.registration.RANSACConvergenceCriteria = registration::RANSACConvergenceCriteria class with max_iteration=1000, and max_validation=1000) -> open3d.open3d.registration.RegistrationResult

Invoked with: geometry::PointCloud with 76 points., geometry::PointCloud with 178 points., std::vector with 27 elements. Use numpy.asarray() to access data.

Did you forget to #include <pybind11/stl.h>? Or <pybind11/complex.h>, <pybind11/functional.h>, <pybind11/chrono.h>, etc. Some automatic conversions are optional and require extra headers to be included when compiling your pybind11 module.

To Reproduce Steps to reproduce the behavior: import open3d as o3d ... (with points_1 and points_2 as o3d.geometry.Pointcloud objects and est_correspondences as a 27x2 numpy array of type np.int32, I can share the files with the data if necessary)

est_correspondences = o3d.utility.Vector2iVector(est_correspondences) reg_res = o3d.registration.registration_ransac_based_on_correspondence(points_1, points_2, est_correspondences)

Expected behavior Should return open3d.registration.RegistrationResult object

Environment (please complete the following information):

preethamam commented 3 years ago

Same problem in Python Open3D.

preethamam commented 3 years ago

Check the inputs. After the right inputs to registration_ransac_based_on_correspondence() it works.

theNded commented 2 years ago

As indicated by the error log, you need to provide max_correspondence_distance which doesn't have a default value.

ArchakGoel commented 2 years ago

@preethamam and @theNded what is the meaning of the field max_correspondence_distance? If I have two point clouds cloud0 and cloud1 that I want to register, how should I determine the value of this field? Lets say I have a set of corresponding points in each point cloud cloud0 and cloud1: idx01, idx11 are points in cloud1 that correspond to idx00, idx10 in cloud0, then how is max_correspondence_distance related to it? The definition in open3d docs is quite vague.