Skip to content

Latest commit

 

History

History
181 lines (142 loc) · 5.19 KB

README.md

File metadata and controls

181 lines (142 loc) · 5.19 KB

Background Removal

A Python-based project for processing Point Cloud Data (PCD) files, featuring background removal and point cloud clustering capabilities.

Features

  • Background removal from point cloud data
  • Point cloud clustering (2D and 3D)
  • Multiple processing methods:
    • Brute force
    • KD-tree
    • Octree
    • Spherical coordinates
    • Voxel-based
  • Ground plane detection
  • Visualization tools

Demo

Background Removal Result

Static Background Removal Result Static Background Removal Result

Demonstration of the background removal process

Setup

  1. Clone the repository:

    git clone https://github.com/moonmoonmoonmoon/static_background_removal.git
    cd background-removal
  2. Install required packages:

    pip install -r requirements.txt

Detailed Usage Guide

Basic Usage

Run the main script with default parameters:

python main.py

Configuration Options

Key parameters that can be adjusted in the processing pipeline:

  1. Background Removal:
  • distance_threshold: Distance threshold for background point detection
  • angle_threshold: Angle threshold for background point detection
  1. Clustering:
  • eps: The maximum distance between two samples for them to be considered neighbors
  • min_samples: The minimum number of samples in a cluster
  1. Ground Detection:
  • distance_threshold: Maximum distance from point to plane for ground classification
  • max_iterations: Number of RANSAC iterations

Project Structure

background-removal/
├── src/
│   ├── clustering/
│   │   ├── __init__.py
│   │   ├── cluster_2d.py
│   │   └── cluster_3d.py
│   ├── find_background/
│   │   ├── __init__.py
│   │   ├── find_cartesian.py
│   │   └── find_spherical.py
│   ├── find_ground/
│   │   ├── __init__.py
│   │   └── find_ground.py
│   ├── process_point_cloud/
│   │   ├── __init__.py
│   │   ├── process_brute.py
│   │   ├── process_kdtree.py
│   │   ├── process_octree.py
│   │   ├── process_spherical.py
│   │   ├── process_voxel.py
│   │   └── utils.py
│   ├── utils/
│   │   ├── __init__.py
│   │   └── utils.py
│   ├── visualization/
│   │   ├── __init__.py
│   │   └── visualization.py
│   └── __init__.py
├── dataset            # Contains datasets for testing
│   │   ├── static         # Static background datasets
│   │   │   └── lowell     # Lowell dataset for static scenes
│   │   ├── moving         # Moving background datasets
│   │   │   └── boston_vehicle_mount # Boston vehicle-mounted dataset for dynamic scenes
├── output             # Output folder for processed data and transmation matrix
├── LICENSE
├── README.md
├── main.py
├── requirements.txt
├── images/
└── tree_generator.py

Module Description

  • clustering/: Implements 2D and 3D point cloud clustering algorithms
  • find_background/: Contains algorithms for background detection in both Cartesian and spherical coordinates
  • find_ground/: Implements ground plane detection algorithms and get transformation martix
  • process_point_cloud/: Core processing algorithms including various optimization methods
  • utils/: Common utility functions
  • visualization/: Tools for visualizing point cloud data and results

Contributing Guidelines

We welcome contributions to improve the project! Here's how you can contribute:

Setting up Development Environment

  1. Fork the repository
  2. Create a virtual environment (using conda):
     conda create -n background-removal python=3.11
     conda activate background-removal
  3. Install development dependencies:
    pip install -r requirements.txt

Code Style

  • Follow PEP 8 coding standards
  • Use meaningful variable and function names
  • Add docstrings to functions and classes
  • Keep functions focused and single-purpose

Making Contributions

  1. Create a new branch for your feature:

    git checkout -b your-branch-name
  2. Make your changes and commit:

    git add .
    git commit -m "Meaningful commit message"
  3. Push to your fork:

    git push origin your-branch-name
  4. Create a Pull Request (PR) from your fork to our main repository

Pull Request Guidelines

  • Provide a clear description of the changes
  • Include any relevant issue numbers
  • Ensure all tests pass
  • Add unit tests for new features
  • Update documentation if needed

Reporting Issues

When reporting issues, please include:

  • A clear description of the problem
  • Steps to reproduce the issue
  • Expected vs actual behavior
  • System information (OS, Python version, etc.)

License

This project is licensed under the MIT License - see the LICENSE file for details.