Sometimes, photo images have defects. This is especially the case for old photos that have been scanned: they may have scratches, spots, and stains. All these imperfections hinder enjoyment of the photo. The procedure of reconstructing parts of an image based on their surroundings is called inpainting, and OpenCV has an implementation of this algorithm. Here, we'll review ways of exploiting this OpenCV functionality.
Removing defects from a photo with image inpainting
Getting ready
Before you proceed with this recipe, you need to install the OpenCV version 3.3 (or greater) Python API package.