Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 1.41 KB

README.md

File metadata and controls

40 lines (25 loc) · 1.41 KB

PyPatchMatch

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.

Prerequisites

Build

  • check OpenCV have been built as the tutorial (Note the version should be v2.2.0)
  • check SYS_PREFIX in setup.py is the correct path of OpenCV libraries

To build, run sh build.sh.

Use

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.

Reference