inpaintCoherent
Restore specific image regions using coherence transport based image inpainting
Description
specifies additional inpainting options using one or more name-value arguments.J
= inpaintCoherent(I
,mask
,Name,Value
)
Examples
Input Arguments
Output Arguments
Tips
The inpainting results depend on the name-value pair specification. You can modify the values of
Radius
andSmoothingFactor
for varied results.Each ROI in the binary mask image must be sufficiently large to enclose the corresponding region in the image to be inpainted.
Algorithms
The coherence transport based inpainting method is a pixel-based approach for removing objects and filling regions in images [1]. Inpainting is performed inwards starting from the boundary pixels of the target region. The inpainting value for a pixel is estimated from its coherent neighboring pixels with known values. The steps involved are summarized as follows:
Identify target regions from the input image to be filled or inpainted. Generate a binary mask of the size same as the input image. The nonzero pixels in the mask image must contain the target regions to be inpainted.
The order in which the pixels in the target region are inpainted is calculated from their Euclidean distance to the boundary of the target region.
The inpainting value for a pixel in the target region is the weighted average of known pixel values within its inpainting radius. The known pixels along the coherence direction are assigned higher weight value than the incoherent neighboring pixels. The coherence direction is estimated by using a structure tensor.
References
[1] F. Bornemann and T. März. "Fast Image Inpainting Based on Coherence Transport." Journal of Mathematical Imaging and Vision. Vol. 28, 2007, pp. 259–278.