Skip to content

zehdari/StereoMatchingTool

Repository files navigation

Stereo Vision Disparity Adjustment Tool

This tool provides a graphical interface for adjusting the disparity map parameters of a stereo vision system. It includes visualizations for depth maps and point clouds and allows for real-time tuning of stereo vision parameters.

Stereo Matching Tool

Features

  • Disparity Map Adjustment: Adjust parameters like numDisparities, blockSize, preFilterCap, uniquenessRatio, etc.
  • Depth Map Visualization: View the depth map in grayscale or color.
  • Point Cloud Visualization: Visualize the 3D point cloud generated from the disparity map.
  • Image Display Modes: Switch between RGB, BGR, and Greyscale display modes for rectified images.
  • Algorithm Toggle: Switch between SGBM and BM stereo matching algorithms.
  • WLS Filter: Option to apply WLS (Weighted Least Squares) filter to the disparity map.
  • Video Playback: Play, pause, and seek within stereo video files.
  • Live Feed Support: Use live stereo camera feeds.

Configuration

Before running the tool, create a config/config.yml file with the following structure:

left_folder: path/to/left/images
right_folder: path/to/right/images
left_camera_config: path/to/left/camera/config.yml
right_camera_config: path/to/right/camera/config.yml
baseline: 120 # mm
BGR: False # Leave False for RGB or Greyscale.
Live: False # Set to True for live stereo feed.

Note: The camera configurations should be in OpenCV format.

Setting Up the Environment

To set up the virtual environment and install the required dependencies, follow these steps:

  1. Create a Virtual Environment:

    python -m venv venv
  2. Activate the Virtual Environment:

    • On Windows:

      venv\Scripts\activate
    • On macOS and Linux:

      source venv/bin/activate
  3. Install the Required Dependencies:

    pip install -r requirements.txt

Usage

  1. Initialize and Run:

    python stereo_vision_app.py
  2. Adjust Parameters: Use the sliders on the left panel to adjust the disparity map parameters.

  3. Switch Modes: Use the buttons on the top panel to switch display modes, toggle depth map color, change algorithms, and apply the WLS filter.

  4. Video Controls: Use the play/pause button and slider to control video playback.

  5. Live Feed: If using live stereo feed, ensure cameras are properly connected and configured.

Running the Application

To run the application, execute the script:

python stereo_matching.py

The application window will open, allowing you to adjust stereo vision parameters and visualize the results in real-time.

Save Settings

You can save the current settings to a file for later use. Use the 'Save Settings' button and provide a filename.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages