Skip to content

This project investigates three advanced image segmentation algorithms—Watershed, Active Contour Snake, and Chan-Vese—for detecting object collisions in 2D simulation environments. Analyzing six diverse video datasets, the study evaluates these algorithms on execution time, segmentation accuracy, and adaptability to dynamic backgrounds and overlapp

Notifications You must be signed in to change notification settings

Sura3607/Integrated_Image_Segmentation-Based_Solution_for_Object-Collision_Detection_in_2D_Simulation_Environ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Integrated Image Segmentation-Based Solution for Object Collision Detection in 2D Simulation Environments

Introduction

Collision detection is a critical component in fields like robotics, virtual reality, medical simulation, and autonomous systems, where accurate modeling of object interactions is essential. This study explores image segmentation-based methods for object collision detection in 2D simulation environments, focusing on three key algorithms:

  • Watershed Algorithm: Effective for separating overlapping objects, though it requires marker-based preprocessing to avoid over-segmentation.
  • Active Contour Snake Model: Captures complex boundaries and adapts to shape changes, but requires precise initialization and is computationally intensive.
  • Chan-Vese Model: Performs well in noisy and low-contrast environments but has slower execution due to iterative optimization.

By analyzing six simulated video datasets with diverse object properties and motion complexities, this research evaluates the algorithms based on execution time, segmentation accuracy, and adaptability to dynamic backgrounds and overlapping objects.

Key findings highlight the trade-offs between algorithmic complexity and real-time performance. Practical applications include gaming, robotics, and automation, with recommendations to enhance computational efficiency and accuracy.


Features

  • Implementation of collision detection algorithms for 2D environments.
  • Analysis and comparison of algorithm performance:
    • Watershed Algorithm: Effective for overlapping objects with marker preprocessing.
    • Active Contour Snake Model: Captures complex boundaries; requires precise initialization.
    • Chan-Vese Model: Robust in noisy and low-contrast scenarios.
  • Results stored as CSV files and visualized through interactive plots.
  • Ready-to-use simulation environment.

Project Structure

├── data/                           # Input data
│   ├── images/                     # Test images
│   └── videos/                     # Test videos
│           
├── results/                        # Experiment results
│   ├── Chan-vese_csv/              # CSV files for Chan-Vese performance
│   ├── Watershed-ACM_csv/          # CSV files for Watershed and Active Contour Snake
│   └── plots/                      # Plots generated from CSV files
│                
├── src/                            # Main source code
│   ├── core/                       # Core algorithms
│   │   ├── active_contour_snake.py # Active Contour Snake algorithm implementation
│   │   ├── base.py                 # Base algorithms (e.g., DFS, BFS)
│   │   ├── chan_vese_collision.py  # Chan-Vese algorithm implementation
│   │   ├── simulation.py           # Video simulation generation
│   │   └── watershed.py            # Watershed algorithm implementation
│   ├── test/                       # Unit tests for algorithms
│   └── main.py                     # Application entry point
│           
├── experiments/                    # Experiment configurations and notes
│   ├── experiment.ipynb            # Performance evaluation.
│   └── Readme.md                   # Experiment details
│           
├── README.md                       # Project documentation
└── requirements.txt                # Required Python libraries

Installation

Follow the steps below to set up the project:

  1. Clone the repository:

    git clone https://github.com/Sura3607/Integrated_Image_Segmentation-Based_Solution_for_Object-Collision_Detection_in_2D_Simulation_Environ.git
    cd your-repo-name
  2. Install dependencies:

    pip install -r requirements.txt
  3. Run the application:

    python src/main.py

Usage

  1. Place input test images or videos into the data/images/ or data/videos/ directories.
  2. Modify configurations in experiments/experiment.md to set up desired experiments.
  3. Execute the main.py script to run the desired algorithm.
  4. Analyze results in the results/ folder:
    • CSV files provide performance metrics.
    • Plots visualized in .ipynb notebooks or saved in the plots/ folder.

Results

Key Findings:

  1. Chan-Vese Algorithm:

    • Efficiency: Demonstrates superior efficiency and stability in processing time analysis.
    • Multi-Color Images: Leverages color information effectively to minimize computational load and maintain stable processing times, even with increased object count or collisions.
    • Grayscale Images: Relies on edge and shape processing, which may result in occasional high processing time peaks. However, the overall fluctuation range remains narrow, making it more efficient compared to other algorithms.
  2. Watershed Algorithm Combined with Active Contour Model (ACM):

    • Average Performance: Exhibits higher average processing times and significant fluctuations, especially in grayscale images or when handling a large number of objects.
    • Multi-Color Images: Performance improves by utilizing color information, but instability and sudden spikes in processing time make the algorithm less optimal.

Result Visualization:

  • Performance metrics and including processing times, are stored in the results/Chan-vese_csv/ and results/Watershed-ACM_csv/ directories.
  • Plots illustrating processing time trends and algorithm comparison are saved in the results/plots/ folder, generated from CSV data.

Contributions

This project advances collision detection by:

  • Enhancing segmentation-based detection methods in 2D environments.
  • Providing practical guidelines for optimizing accuracy and speed.

Future Work

  • Extend to 3D environments for more complex simulations.
  • Develop adaptive, real-time segmentation techniques.
  • Integrate machine learning for improved scalability and robustness.

Acknowledgments

Special thanks to the contributors and open-source community for providing tools and resources.


About

This project investigates three advanced image segmentation algorithms—Watershed, Active Contour Snake, and Chan-Vese—for detecting object collisions in 2D simulation environments. Analyzing six diverse video datasets, the study evaluates these algorithms on execution time, segmentation accuracy, and adaptability to dynamic backgrounds and overlapp

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •