Image Matting is a crucial process in accurately estimating the foreground object in images and videos. It finds extensive applications in various domains, particularly in film production for creating visual effects.
This project implements the "A Closed Form Solution to Natural Image Matting" method proposed by A. Levin, D. Lischinski, and Y. Weiss.
A detailed report of our work will be added soon...
An online demo of this work is available here. Users can test the image matting algorithm with their own images through this interactive demo. There are some examples available on the website, or simply upload an image and the scribbles to the demo interface and obtain the results of foreground and background estimation.
Here is an example of input image, scribbles image, and the obtained result:
Original image | Scribbled image | Output alpha |
---|---|---|
- Clone the repository
git clone https://github.com/reproductible-research/image-matting-with-a-closed-form-solution.git
cd image-matting-with-a-closed-form-solution
- Set up a conda environment with Python 3.9
conda create -n matting python=3.9 -y
conda activate matting
- Install the required packages
pip install -r requirements.txt
- Run the main script with the input image and scribbles image
python main.py input_image.png -s scribbles.png