Skip to content

a Cython wrapper of inpainting technique based on PatchMatch

License

Notifications You must be signed in to change notification settings

maktu6/PyPatchMatch

Repository files navigation

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

About

a Cython wrapper of inpainting technique based on PatchMatch

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages