Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 3/22/2024
Public
Document Table of Contents

InpaintInit

Initializes the state structure for image inpainting.

Syntax

IppStatus ippiInpaintInit_8u_C1R(IppiInpaintState_8u_C1R** ppState, const Ipp32f* pDist, int distStep, const Ipp8u* pMask, int maskStep, IppiSize roiSize, Ipp32f radius, IppiInpaintFlag flags, Ipp8u* pStateBuf, Ipp8u* pBuf);

IppStatus ippiInpaintInit_8u_C3R(IppiInpaintState_8u_C3R** ppState, const Ipp32f* pDist, int distStep, const Ipp8u* pMask, int maskStep, IppiSize roiSize, Ipp32f radius, IppiInpaintFlag flags, Ipp8u* pStateBuf, Ipp8u* pBuf);

Include Files

ippcv.h

Domain Dependencies

Headers: ippcore.h, ippvm.h, ipps.h, ippi.h

Libraries: ippcore.lib, ippvm.lib, ipps.lib, ippi.lib

Parameters

ppState
Double pointer to the state structure for image inpaiting.
pDist
Pointer to the ROI of the image of distances.
distStep
Distance, in bytes, between the starting points of consecutive lines in the image of distances.
pMask
Pointer to the mask image ROI.
maskStep
Distance, in bytes, between the starting points of consecutive lines in the mask image.
roiSize
Size of the image ROI, in pixels.
radius
Radius of the neghborhood used for inpainting (distradius pixels are processed).
flags
Specifies algorithm for image inpainting. Possible values:

IPP_INPAINT_TELEA

Telea algorithm

IPP_INPAINT_NS

Navier-Stokes equation
pStateBuf

Pointer to the buffer for the state structure initialization.

pBuf

Pointer to the external work buffer.

Description

This function operates with ROI (see Regions of Interest in Intel IPP).

This function initializes the ppState structure for direct methods of image inpainting. This structure is used by the ippiInpaint function and can be applied to process images of the same size roiSize.

Zero pixels of the pMask image correspond to the known image pixels, non-zero pixels - to the unknown image pixels that should be restored. The distance image pDist specifies the order of pixel inpainting. Values of unknown pixels are restored in ascending order depending on their distances. The radius parameter specifies the radius of the circular neighborhood that affects the restoration of the central pixel. The flag parameter specifies the method of direct inpainting. Two methods are supported: Telea algorithm [Telea04] and Navier-Stokes equation [Bert01].

For an example on how to use this function, refer to the example provided with the ippiInpaint function description.

NOTE:
The image ROI must not exceed the maximum width and height of roiSize specified in the initialization function.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or a warning.

ippStsNullPtrErr

Indicates an error when one of the specified pointers is NULL.

ippStsSizeErr

Indicates an error when width or height of the image is less than, or equal to zero.

ippStsStepErr

Indicates an error when the step of the mask or distance image ROI is too small.

ippStsNotEvenStepErr

Indicates an error when the step value is not divisible by the pDist element.

ippStsBadArgErr

Indicates an error when radius is less than 1, or flags has an illegal value.

See Also