Back to FabImage Studio website

You are here: Start » Filter Reference » Image » Image Enhancement » InpaintImage_Bornemann

InpaintImage_Bornemann


Module: FoundationPro

Fills in a region of an image with pixel values interpolated from the borders of the area; uses fast marching method and coherence analysis.

Applications

Speculative setting of unknown (or unwanted) pixels. This version is giving the best results among reasonably fast traditional methods.
Name Type Range Description
Input value inImage Image Input image
Input value inRegionToInpaint Region
Input value inRange Integer 1 - + Defines how far a pixel can be from one currently being inpainted to be considered in calculations
Input value inPreSmoothing Real 0.0 - Standard deviation of a gaussian kernel used before inpainting calculations
Input value inPostSmoothing Real 0.0 - Standard deviation of a gaussian kernel used after initial inpainting calculations
Input value inSharpness Real 0.0 - Desired sharpness of edges inside of the inpainted region (higher = sharper)
Input value inLuminanceMode LuminanceMode Determines how the luminance of the input image will be computed
Output value outImage Image Output image

Description

This filter inpaint a region of an image using the fast marching method and coherence flow analysis.

Each inpainted pixel is filled with a color calculated as a weighted average of all already known (i.e. those outside of the inpainting range or those that were already) pixels withing a range specified by the parameter inRange. Using a higher range will result in smoother edges withing the inpainted region. The calculation of the weights is done by analyzing the coherence flow of the input image which is previously smoothed with a gaussian kernel with the standard deviation given in inPreSmoothing. This means that lower values of this parameter will result in more detail being preserved but it may also introduce unwanted artifacts. After computing the coherence direction and strength, those values are also smoothed to allow for better preservation of angled edges. This smoothing is done using a kernel with the standard deviation given in inPostSmoothing. Higher values of this parameter higher quality estimation of angles within the inpainted region but it will also increase the work time of this filter. Additionally one can specify how important the coherence flow information is by using the inSharpness parameter (Setting inSharpness to zero will mean that coherence information is to be ignored). Higher values will stress the importance of preserving the structure of the inpainted image and will result in sharper edges.

Hints

  • To preserve color information of 3-channel images in a way that is more suited for a human eye, set inLuminanceMode to YUV.
  • Sometimes higher values of inPreSmoothing are needed to filter out noise that might interfere with coherence direction calculations.
  • Increasing inSharpness can help prevent blurred edges withing the inpainting region.
  • If round edges are expected withing the inpainting region, high values of inPostSmoothing are recommended.

Examples

Comparison between low and high values of inRange. From the left: input, output with inRange = 4, output with inRange = 12

Comparison between low and high values of inPreSmoothing. From the left: input, output with inPreSmoothing = 1, output with inPreSmoothing = 3

Comparison between low and high values of inPostSmoothing. From the left: input, output with inPostSmoothing = 1, output with inPostSmoothing = 6

Comparison between different values of inSharpness. From top left: input, output with inSharpness = 1, output with inSharpness = 25, output with inSharpness = 100

An example inpaint done with inRange = 6, inPreSmoothing = 1.5, inPostSmoothing = 6 and inSharpness = 35

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError Expainting region (inRegionToExpaint) exceeds the image in InpaintImage_Bornemann.
DomainError No pixels available at the edge of inRegionToExpaint in InpaintImage_Bornemann.

Complexity Level

This filter is available on Advanced Complexity Level.

Filter Group

This filter is member of InpaintImage filter group.

See Also

  • InpaintImage – Fills in a region of an image with pixel values interpolated from the borders of the area.
  • InpaintImage_Telea – Fills in a region of an image with pixel values interpolated from the borders of the area; uses fast marching method.
  • ExpaintImage_Telea – Speculatively sets pixel values outside of a region using the fast marching method.
  • ExpaintImage_Bornemann – Speculatively sets pixel values outside of a region using the fast marching method and coherence analysis.