https://github.com/zqpei/patchmatch_inpainting
Implementation of PatchMatch for image inpainting in cpp
https://github.com/zqpei/patchmatch_inpainting
exemplar-based-image-inpainting inpainting opencv3 patchmatch
Last synced: about 1 month ago
JSON representation
Implementation of PatchMatch for image inpainting in cpp
- Host: GitHub
- URL: https://github.com/zqpei/patchmatch_inpainting
- Owner: ZQPei
- License: other
- Created: 2019-08-08T11:52:34.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-17T16:43:06.000Z (over 5 years ago)
- Last Synced: 2025-04-24T18:51:19.883Z (6 months ago)
- Topics: exemplar-based-image-inpainting, inpainting, opencv3, patchmatch
- Language: C++
- Homepage:
- Size: 3.45 MB
- Stars: 49
- Watchers: 3
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PatchMatch for inpainting
   
## Introduction
This repository borrows most of the code from [younesse-cv](https://github.com/younesse-cv/PatchMatch). 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](https://github.com/zvezdochiot) for suggestion.
## Dependencies
- cmake > 2.8
- opencv 3.x
- g++-4.7## How to use
- Download this repository
```bash
git clone https://github.com/ZQPei/patchmatch_inpainting.git
```- Compile
```bash
mkdir build
cd build
cmake ..
make
cd ..
```- Run
As what does in `run.sh`.```bash
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:
```sh
./build/patchmatch image_files/forest/forest.bmp \
image_files/forest/forest_mask.png \
image_files/forest/forest_inpaint.png
```## Demo
| mask | masked image | inpainting image using PatchMatch | origin image |
| ----------------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------------------- | ------------------------------------------------------------ |
|  |  |  |  |## References
https://github.com/younesse-cv/PatchMatch