This repository borrows most of the code from younesse-cv. However that repository is C style, which cannot be compiled using opencv 3.x
. What I did is wrapping the code using opencv 3.x
API in C++ style. Thanks zvezdochiot for suggestion.
Download this repository
git clone https://github.com/ZQPei/patchmatch_inpainting.git
Compile
mkdir build
cd build
cmake ..
make
cd ..
Run
As what does in run.sh
.
for i in 0 1 2; do
./build/patchmatch image_files/inpainting/image/image_0000$i.png \
image_files/inpainting/mask/mask_0000$i.png \
image_files/inpainting/output/output_0000$i.png \
image_files/inpainting/metrics.log \
$i;
done
Or simple:
./build/patchmatch image_files/forest/forest.bmp \
image_files/forest/forest_mask.png \
image_files/forest/forest_inpaint.png
mask | masked image | inpainting image using PatchMatch | origin image |
---|---|---|---|