ClassesClassesClassesClasses | | | | Operators

inpainting_textureinpainting_textureInpaintingTextureinpainting_textureInpaintingTextureInpaintingTexture (Operator)


inpainting_textureinpainting_textureInpaintingTextureinpainting_textureInpaintingTextureInpaintingTexture — Perform an inpainting by texture propagation.


inpainting_texture(Image, Region : InpaintedImage : MaskSize, SearchSize, Anisotropy, PostIteration, Smoothness : )

Herror inpainting_texture(const Hobject Image, const Hobject Region, Hobject* InpaintedImage, const Hlong MaskSize, const Hlong SearchSize, double Anisotropy, const char* PostIteration, double Smoothness)

Herror T_inpainting_texture(const Hobject Image, const Hobject Region, Hobject* InpaintedImage, const Htuple MaskSize, const Htuple SearchSize, const Htuple Anisotropy, const Htuple PostIteration, const Htuple Smoothness)

Herror inpainting_texture(Hobject Image, Hobject Region, Hobject* InpaintedImage, const HTuple& MaskSize, const HTuple& SearchSize, const HTuple& Anisotropy, const HTuple& PostIteration, const HTuple& Smoothness)

HImage HImage::InpaintingTexture(const HRegion& Region, const HTuple& MaskSize, const HTuple& SearchSize, const HTuple& Anisotropy, const HTuple& PostIteration, const HTuple& Smoothness) const

HImageArray HImageArray::InpaintingTexture(const HRegion& Region, const HTuple& MaskSize, const HTuple& SearchSize, const HTuple& Anisotropy, const HTuple& PostIteration, const HTuple& Smoothness) const

void InpaintingTexture(const HObject& Image, const HObject& Region, HObject* InpaintedImage, const HTuple& MaskSize, const HTuple& SearchSize, const HTuple& Anisotropy, const HTuple& PostIteration, const HTuple& Smoothness)

HImage HImage::InpaintingTexture(const HRegion& Region, Hlong MaskSize, Hlong SearchSize, double Anisotropy, const HString& PostIteration, double Smoothness) const

HImage HImage::InpaintingTexture(const HRegion& Region, Hlong MaskSize, Hlong SearchSize, double Anisotropy, const char* PostIteration, double Smoothness) const

void HOperatorSetX.InpaintingTexture(
[in] IHUntypedObjectX* Image, [in] IHUntypedObjectX* Region, [out] IHUntypedObjectX*InpaintedImage, [in] VARIANT MaskSize, [in] VARIANT SearchSize, [in] VARIANT Anisotropy, [in] VARIANT PostIteration, [in] VARIANT Smoothness)

IHImageX* HImageX.InpaintingTexture(
[in] IHRegionX* Region, [in] Hlong MaskSize, [in] Hlong SearchSize, [in] double Anisotropy, [in] BSTR PostIteration, [in] double Smoothness)

static void HOperatorSet.InpaintingTexture(HObject image, HObject region, out HObject inpaintedImage, HTuple maskSize, HTuple searchSize, HTuple anisotropy, HTuple postIteration, HTuple smoothness)

HImage HImage.InpaintingTexture(HRegion region, int maskSize, int searchSize, double anisotropy, string postIteration, double smoothness)


The operator inpainting_textureinpainting_textureInpaintingTextureinpainting_textureInpaintingTextureInpaintingTexture is used for removing large objects and image errors from the region RegionRegionRegionRegionRegionregion of the input image ImageImageImageImageImageimage. Image blocks of side length MaskSizeMaskSizeMaskSizeMaskSizeMaskSizemaskSize are copied from the intact part of the image to the border of the computation area, until that area has been filled up with new gray values. This process is called image inpainting. Hence, the computation area is also referred to as the inpainting area and is reduced with every inserted rectangle, starting with RegionRegionRegionRegionRegionregion. Let the center of the current block be at the point x. Since x is always chosen from the border of the inpainting area the current block overlaps with the known or already filled-in gray values. The gray value correlation with the overlapping part of this block is used to determine which other image block fits at the position x. As the correlation function, the sum of the squared gray value differences is used. The image blocks that are taken into account for the correlation, and hence as candidates for the data source of the next inpainting step, are called comparison blocks. The search area for suitable gray value patterns in which the centers of the comparison blocks is searched is limited to a square of side length 2*SearchSizeSearchSizeSearchSizeSearchSizeSearchSizesearchSize around the point x.

On the one hand, the order in which the pixels of RegionRegionRegionRegionRegionregion are filled in depends on the size of the overlapping area and thus the number of pixels available for the correlation. On the other hand, the absolute value of the derivative of the gray value function tangential to the border of the computation area is also considered. The larger the value of the parameter AnisotropyAnisotropyAnisotropyAnisotropyAnisotropyanisotropy is, the more the points in which the derivative is large are preferred. This way it can be achieved that, e.g., straight lines which are represented by large gradients, are continued through the entire computation area without being interrupted by the inpainting of image structures from other parts of the border when the size of the inpainting area becomes small. On the other hand, a large value of AnisotropyAnisotropyAnisotropyAnisotropyAnisotropyanisotropy also means that possible phantom edges, i.e., unwanted random structures that have developed during the inpainting process, are also propagated and the magnitude of those image disturbances is increased.

To confine the formation of such artifacts, the original algorithm can be extended by a post-iteration step that selects smooth and inconspicuous image patches as data sources for the inpainting. If the parameter PostIterationPostIterationPostIterationPostIterationPostIterationpostIteration is set to 'min_grad'"min_grad""min_grad""min_grad""min_grad""min_grad" the sum of the squares of the gray value gradients is minimized on the comparison blocks. With the value 'min_range_extension'"min_range_extension""min_range_extension""min_range_extension""min_range_extension""min_range_extension", the growth of the gray value interval of the comparison blocks with respect to the reference block around the point x is minimized. If PostIterationPostIterationPostIterationPostIterationPostIterationpostIteration has the value 'none'"none""none""none""none""none" no post-iteration is performed. The choice of feasible blocks for this minimization process is determined by the parameter SmoothnessSmoothnessSmoothnessSmoothnessSmoothnesssmoothness, which is an upper limit to the permitted increase of the mean absolute gray value difference between the comparison blocks and the reference block with respect to the block that was selected by the original algorithm. With increasing value of SmoothnessSmoothnessSmoothnessSmoothnessSmoothnesssmoothness, the inpainting result becomes smoother and loses structure. The matching accuracy of the selected comparison blocks decreases. If SmoothnessSmoothnessSmoothnessSmoothnessSmoothnesssmoothness is set to 0, the post-iteration only considers comparison blocks with an equally high correlation to the reference block.

If the inpainting process cannot be completed because there are points x, for which no complete block of intact gray value information is contained in the search area of size SearchSizeSearchSizeSearchSizeSearchSizeSearchSizesearchSize, the remaining pixels keep their initial gray value and the ROI of the output image InpaintedImageInpaintedImageInpaintedImageInpaintedImageInpaintedImageinpaintedImage is reduced by the region that could not be processed. If the structure size of the ROI of ImageImageImageImageImageimage or of the computation area RegionRegionRegionRegionRegionregion is smaller than MaskSizeMaskSizeMaskSizeMaskSizeMaskSizemaskSize, the execution time of the algorithm can increase extremely. Hence, it is recommended to only use clearly structured input regions.



ImageImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject (byte / uint2 / real)

Input image.

RegionRegionRegionRegionRegionregion (input_object)  region objectHRegionHRegionHRegionHRegionXHobject

Inpainting region.

InpaintedImageInpaintedImageInpaintedImageInpaintedImageInpaintedImageinpaintedImage (output_object)  image(-array) objectHImageHImageHImageHImageXHobject * (byte / uint2 / real)

Output image.

MaskSizeMaskSizeMaskSizeMaskSizeMaskSizemaskSize (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Size of the inpainting blocks.

Default value: 9

Suggested values: 7, 9, 11, 15, 21

Restriction: MaskSize >= 3 && odd(MaskSize)

SearchSizeSearchSizeSearchSizeSearchSizeSearchSizesearchSize (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Size of the search window.

Default value: 30

Suggested values: 15, 30, 50, 100, 1000

Restriction: 2 * SearchSize > MaskSize

AnisotropyAnisotropyAnisotropyAnisotropyAnisotropyanisotropy (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Influence of the edge amplitude on the inpainting order.

Default value: 1.0

Suggested values: 0.0, 0.01, 0.1, 0.5, 1.0, 10.0

Restriction: Anisotropy >= 0

PostIterationPostIterationPostIterationPostIterationPostIterationpostIteration (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Post-iteration for artifact reduction.

Default value: 'none' "none" "none" "none" "none" "none"

List of values: 'min_grad'"min_grad""min_grad""min_grad""min_grad""min_grad", 'min_range_extension'"min_range_extension""min_range_extension""min_range_extension""min_range_extension""min_range_extension", 'none'"none""none""none""none""none"

SmoothnessSmoothnessSmoothnessSmoothnessSmoothnesssmoothness (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Gray value tolerance for post-iteration.

Default value: 1.0

Suggested values: 0.0, 0.1, 0.2, 0.5, 1.0

Restriction: Smoothness >= 0



ClassesClassesClassesClasses | | | | Operators