My implementation is based on the paper poisson image editing. The method is based on solving a Poisson equation, which allows for the transfer of gradients between the two images while preserving the overall structure of the target image.
Clone the repo:
git clone https://github.com/mejhana/Poisson-Editing.git
Set up enviornment
conda env create -f environment.yml
conda activate PoissonEditing
- Download 2 images and put them in the images directory
- Align the source image in the desired location on the destination image and fill the rest of the pixels with black such that source and destination images are of same size
- For the aligned and filled source image, get a ROI using any image annotating tool.
- If you are using VGG annotation tool, export the annotation as a json file (annotations -> export annotations as json), place this file in the project folder. Rename this file as "annotation.json"
- Run main.py, change "clone" to False, if you want to implement fill and set "mixGrad" to True if you want to use mixture of gradients