Code Monkey home page Code Monkey logo

mono2sgm's Introduction

RGB to depth generation

NOTE! This project can be used as data augmentation for generating real depth camera like depth images

Generating SGM calculated disparity estimation from monocular RGB image. This project provides a python based library which generates stereo disparity map from a single image input.

This project is highly based on "Watson, Jamie, et al. "Learning stereo from single images." European Conference on Computer Vision. Springer, Cham, 2020". Refer to it for more mathmatical details.

Purpose

  • This project is a data augmentation projection for depth-related image observations.
  • To simulate a real traditional stereo-camera based depth estimation result from the estimated dense depth map.

Pipeline

The synthetic stereo disparity generation pipeline

Inputs

The stereo generator assumes the following data are given:

  • 1 RGB image as the left eye view (can be right eye as well, does not matter)
  • 1 corresponding predicted disparity map (any monocular depth estimation is appliable).
  • The depth estimation module to be added here...

Usage

  • Refer to example.py for more detailed examples. Please check the comments in example.py
python example.py
  • Feel free to change the image path using the images in folder "testsets" a link

Results

Using OpenCV provided SGBM (no post-processing), we can synthesize a rough disparity: The simple OpenCV syntheziation

Using a 3rd party SGM (with post-processing) and well finetuned post-processing filtering (e.g.MSE), we can synthesize relatively well disparity maps, but very time-consuming: The 3rd party SGM disparity calculation results

Parameters

If bad quality disparity map generation map is required, test these parameters:

  1. increase the max_disparity_range lower bound value, when it is > 80, e.g.max_disparity_range=(80, 190), the quality gets bad (because the are more holes in generated right eye view)
  2. make fix_disparity_scale True (so that will always generate high disparity views)
  3. modify the hyper-paramters of SGM in function st_converter.convert_stereo(), different prefiltering and post-filtering will affect the quality of disparity estimation
  4. augmenting the synthesized right eye view, to add noise to the right eye imgae, then disparity estimation may perform bad: disable_synthetic_augmentation=False

To-do

  • Add monocular depth/disparity estimation modules

References

Citatons

If you use this projection, please cite the references mentioned above, and this repository:

@misc{github,
  author={github},
  title={mono2SGM},
  year={2022},
  url={https://github.com/uenian33/mono2SGM},
}

mono2sgm's People

Contributors

uenian33 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.