PyPatchMatch is a Cython wrapper of inpainting technique based on PatchMatch for restoring the miss area in an image.
The porject mainly based on a C implementation of PatchMatch and a cython wrapper of np.array <-> cv::Mat.
- cmake
- OpenCV 2.2.0
- python 3.5
- cython
- numpy
- check OpenCV have been built as the tutorial (Note the version should be v2.2.0)
- check
SYS_PREFIX
insetup.py
is the correct path of OpenCV libraries
To build, run sh build.sh
.
PyPatchMatch_inpaint(input, mask, radius)
Args:
- input: the original RGB image (a HxWx3
numpy.array
) - mask: the miss mask of image, the value in miss area is 1 (a HxW
numpy.array
) - radius: patch radius
Return:
- the result RGB image (a HxWx3
numpy.array
)
demo.ipynb
is an example of inpainting images via PyPatchMatch.