PyPatchMatch is a Cython wrapper of inpaint algorithm based on PatchMatch for inpainting 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
- check
SYS_PREFIX
insetup.py
is 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.