You are here: Start » AVL.NET » Function Reference » Image » Image Enhancement » AVL.InpaintImage_Bornemann

AVL.InpaintImage_Bornemann

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

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void InpaintImage_Bornemann
(
	AvlNet.Image inImage,
	AvlNet.Region inRegionToInpaint,
	int inRange,
	float inPreSmoothing,
	float inPostSmoothing,
	float inSharpness,
	AvlNet.LuminanceMode inLuminanceMode,
	AvlNet.Image outImage
)

Parameters

Name Type Range Default Description
inImageAvlNet.ImageInput image.
inRegionToInpaintAvlNet.Region
inRangeint<1, +INF>6Defines how far a pixel can be from one currently being inpainted to be considered in calculations. Default value: 6.
inPreSmoothingfloat<0.0f, INF>2.0fStandard deviation of a gaussian kernel used before inpainting calculations. Default value: 2.0f.
inPostSmoothingfloat<0.0f, INF>3.0fStandard deviation of a gaussian kernel used after initial inpainting calculations. Default value: 3.0f.
inSharpnessfloat<0.0f, INF>35.0fDesired sharpness of edges inside of the inpainted region (higher = sharper). Default value: 35.0f.
inLuminanceModeAvlNet.LuminanceModeYUVDetermines how the luminance of the input image will be computed. Default value: YUV.
outImageAvlNet.ImageOutput 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.

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

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.

See also