inpaintExemplar
Restore specific image regions using exemplar-based image inpainting
Description
specifies additional inpainting options using one or more name-value arguments.J
= inpaintExemplar(I
,mask
,Name,Value
)
Examples
Input Arguments
Output Arguments
Algorithms
The exemplar-based image inpainting algorithm is a patch-based approach that restores target regions in the input image by using these steps.
Identify target regions from the input image.
Generate a binary mask of the same size as the input image. The nonzero pixels in the mask image must correspond to the target regions to be inpainted.
Identify the source region. All regions, excluding the target regions, in the input image comprise the source region. That is, source region = input image − target regions.
For every patch of size p-by-s centered on a boundary pixel in the target region, compute the patch priority by using the gradient or tensor method.
Find the patch with the maximum priority. This patch constitutes the target patch to be inpainted.
Given the target patch, search for the best-matching patch in the source region by using the sum of square difference (SSD).
Copy image data from the best-matching patch to the target patch.
Update the input image, mask, and patch priority value.
Repeat steps 4–8 until the target regions are inpainted.
References
[1] Criminisi, A., P. Perez, and K. Toyama. "Region Filling and Object Removal by Exemplar-Based Image Inpainting." IEEE Transactions on Image Processing. Vol. 13, No. 9, 2004, pp. 1200–1212.
[2] Le Meur, O., M. Ebdelli, and C. Guillemot. "Hierarchical Super-Resolution-Based-Inpainting." IEEE Transactions on Image Processing. Vol. 22, No. 10, 2013, pp. 3779–3790.