This is a simple computer vision application program that uses a pair of stereo images taken simultaneously from different angles using the stereo camera setup. This concept is widely used to find the depth of different object pixels in an image. The calculation of depth value can then be used in various applications like segmenting object-background pair, applying 3-D effects to an image, applying various filters to an image. This program aims to illustrate the application of disparity and depth images obtained from the input stereo image pair to segment the object and background pixels by applying a blur effect.
Pre-Requisite: Python 3.1 or higher
- Clone the source code into your local directory.
- Create a virtual environment.
- Install required libraries (given in requirements.txt) in the virtual environment.
git clone https://github.com/sumitprdrsh/Disparity_Images.git #For cloning the source code in local directory
pip install -r requirements.txt #Install required libraries
- Run the below command in terminal from the project's root directory (Disparity_Images folder).
python src/main.py
This type of program can be used in mobile phone cameras to find the depth of various objects in an image. The following files can be viewed to observe the image processing pipeline.
> Input images: data/girlL.png and data/girlR.png
> Disparity image: data/disparity_32_51.png
> Depth image: data/depth_32_51.png
> Output image: data/girlL_32_51_output.jpg
> Image Comparison: data/girlL_32_51_table.jpg
- The code is not refactored yet.
- The code is not tested on other sets of similar disparity images.
- The disparity map parameter input is not automated.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.