OpenCV
4.5.1
Open Source Computer Vision
|
In this tutorial we will show how to use the algorithm Rapid Frequency Selective Reconstructiom (FSR) for image inpainting.
Image Inpainting is the process of reconstructing damaged or missing parts of an image. This is achieved by replacing distorted pixels by pixels similar to the neighboring ones. There are several algorithms for inpainting, using different approaches for such replacement.
One of those algorithms is called Rapid Frequency Selectice Reconstruction (FSR). FSR reconstructs image signals by exploiting the property that small areas of images can be represented sparsely in the Fourier domain. See [85] and [208] for details.
FSR can be utilized for the following areas of application:
The following sample code shows how to use FSR for inpainting. The non-zero pixels of the error mask indicate valid image area, while zero pixels indicate area to be reconstructed. You can create an arbitrary mask manually using tools like Paint or GIMP. Start with a plain white image and draw some distortions in black.
Original and distorted image:
Reconstruction:
Left image: fast quality profile (run time 8 seconds). Right image: best quality profile (1 minute 51 seconds).