isl-org / Open3D

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

Pose graph optimization not close loops? #4575

Closed szx0112 closed 2 years ago

szx0112 commented 2 years ago

Checklist

My Question

Hi,

I used the pose graph optimization as in the multiway registration to reconstruct a scene. The odometry edge and loop closure edge are defined by setting uncertain=True/False to each o3d.pipelines.registration.PoseGraphEdge. However, I found the method cannot properly close loop even I visit the same place twice.

An example is shown below, the zoomed region is where the loop should be closed. The camera scan the surface at close distance, thus there are sufficient overlaps between the new first images and the last ones.

I have tried some feature-based technique, and successfully detect and close such loops. I found the frame-to-frame odometry computed from open3d rgbd odometry shows more accurate results, but I have difficulty on closing the loops.

Is there any way to improve the detectability of the loops? Any comment is really appreciated.

Screenshot from 2022-01-10 18-28-05

Screenshot from 2022-01-10 18-35-17

theNded commented 2 years ago

How did you construct the pose graph for the loop closure edges? Did you use RANSAC or FGR?

szx0112 commented 2 years ago

@theNded Thanks for the reply. I follow the tutorial Multiway_Registration for constructing both the odometry and loop closure edges. I use o3d.pipelines.odometry.compute_rgbd_odometry to find the transformations between every pair of rgbd images and construct the pose graph. I don't think RANSIC is used in the graph optimization.

When I increase the value of preference_loop_closure to 2.0 (from the default 0.1 ), the loops can be closed sometime. But I cannot get consistent results (always close loops). I see other post used very large preference_loop_closure such as 120.0 as in this #974. Any criteria to properly define this parameter?

While I am testing the results (with different preference_loop_closures), the overall reconstruction process is quite slow. It took around 25 mins for each run (around 300 frames at 640x360). Any method we can also improve the reconstruction speed?

Thanks.

theNded commented 2 years ago

Sorry for the late reply. The pose graph optimization module in Open3D serves as the backend. It generally assumes very rich loop closures, meaning we have almost exhaustive N^2 putative loop closures. Then aggressive pruning is applied to remove unreliable loop closures.

In view of this, RANSAC is frequently used as the frontend loop closure detection for point clouds, and no specific frontend is implemented natively for RGBD images -- RGBD odometry is technically not a loop detection approach and is unreliable; a better option is feature-based matching, which is used in the python reconstruction system with OpenCV's components.

The legacy reconstruction system is on CPU, so it is a bit slow. We are working on the tensor-based system, where we have most components, but the entire system is still not ready.

szx0112 commented 2 years ago

Thanks for the explanation. Now I can close the loop and obtain the expected results. Please feel free to close the issue. Thanks.

nithishnks commented 2 years ago

@szx0112 I am blocked by a similar loop closure issue. Could you talk about the changes you made to the configuration file to solve the loop closure problem in your case?

szx0112 commented 2 years ago

Hi @nithishnks You can increase the preference_loop_closure parameter to trust more the detected loops than odometry. See http://www.open3d.org/docs/release/python_api/open3d.pipelines.registration.GlobalOptimizationOption.html.

If it still not works for your case, you can try to develop your own graph using G2o.