This is a tool to obtain segmented planes from depth images given a bag file, and visualise the same.
Contains a comparison of my attempt of implementation of RANSAC and Open3D's segment_plane.
results contains results from previous runs
.
├── main.py
├── classes.py # Core logic; contains PlaneModel, RansacModel, and helper functions
├── exporter.py # Utility module; handles CSV, TXT, and JPG grid generation
├── depth.db3 # Input ROS2 bag file
├── results /
├───── run{iter} /
├───────── results_table.csv # Image index, normal angle, and visible area
├───────── rotation_axis.txt # Estimated 3D axis of rotation vector
└───────── segmented_planes_grid.jpg # Visualization grid with green-shaded planes
- uv should be installed - astral.sh/uv
uv venv
source .venv/bin/activate
uv pip install -r requirements.txtnumpy should be 1.26.4, else it crashes.
Make sure to rename the .db3 to your respective one in main.py.
Also update your camera intrinsics in the classes.py file.
For Realsense devices, run
realsense-enumerate-devices -cto get your camera intrinsics for the desired resolution in the bag file.
python main.py