Skip to content
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

Enhance RANSAC Alignment with Inliers, Keypoint Pairs, and Alignment Time Visualization #48

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jlaserna
Copy link
Contributor

PR Summary

This PR introduces several improvements to the map closure process, focusing on the RANSAC alignment, visualization of keypoint pairs and inliers, and performance tracking.

Key Changes

1. Return Inliers Instead of Number of Inliers in RansacAlignment2D

  • The function RansacAlignment2D now returns a pair containing the alignment transform (Eigen::Isometry2d) and a list of inlier point pairs instead of just the number of inliers. This change allows for more detailed information about the inliers during the map closure process.

2. Updated ClosureCandidate Struct

  • The ClosureCandidate struct has been updated to store additional information, including:
    • keypoint_pairs: A vector of keypoint pairs used in the alignment.
    • inliers: A vector of inlier keypoint pairs.
    • alignment_time: The time taken to perform the alignment in milliseconds.

3. Updated Map Closures Processing

  • The MapClosures::ValidateClosure function now measures the time taken for RANSAC alignment and records the keypoint pairs and inliers for each closure. This data is stored in the ClosureCandidate struct and used for further visualization and analysis.

4. Enhanced Python API

  • The Python API has been updated to handle the new structure of the ClosureCandidate and pass additional information such as keypoint pairs, inliers, and alignment time to the visualization layer.

  • The MapClosurePipeline class now passes number_of_inliers, alignment_time, keypoint_pairs, and inliers to the visualizer.

5. Visualization Improvements

  • The ClosuresVisualizer class has been enhanced to visualize inliers and keypoint pairs in the density map viewer. The user can now toggle the visibility of outliers through a new tool (ToggleOutliersTool), and inliers and outliers are displayed with different colors and markers for easier identification.

  • The alignment time is displayed in the title of the plot, and users can see the time taken for each alignment and the number of inliers.

6. New Outliers Toggle Tool

  • A new tool (ToggleOutliersTool) has been added to allow toggling the visibility of outliers in the visualizer. This feature is useful for debugging and analyzing the quality of the alignment.

Additional Files and Changes

  • New Icon: A new icon (outliers.png) has been added for the outliers toggle button.
  • Performance Tracking: The alignment time is now recorded and displayed in both the Python pipeline and the visualizer.
  • Python Updates: The map_closures_pybind.cpp file has been updated to expose the new ClosureCandidate fields (keypoint_pairs, inliers, alignment_time) to Python.

How to Test

  1. Build and Run the Project:

    • Ensure the changes are correctly integrated and that there are no build issues.
  2. Check the Output:

    • Run the map closure process and verify that the RANSAC alignment correctly outputs the keypoint pairs and inliers, along with the alignment time.
  3. Use the Visualizer:

    • Launch the visualizer and check that keypoint pairs and inliers are correctly displayed. Use the outliers toggle tool to show/hide outliers in the visualizer.
  4. Python Pipeline:

    • Run the Python pipeline and ensure that keypoint pairs, inliers, and alignment time are correctly passed and displayed.

Motivation

These changes were made to provide more transparency into the alignment process by exposing additional data, including the time taken for the alignment and the specific keypoints used in the alignment. The ability to toggle and visualize outliers will help with debugging and improving the accuracy of the map closure algorithm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant