Image Inpainting

This algorithm extrapolates the values of an image in regions defined by a mask.

Input

Either a single image or volume with an attached mask or two images/volumes without. The latter options requires the second image to be unsigned 8bit and have the same size and number of channels as the first.

The first input is the image that will be extrapolated. The second input is the mask that defines the areas where the values should be extrapolated.

Output

The extrapolated image if the parameter Create New Image is set to true, otherwise none (the input image will be modified).

Description

The algorithm considers that all masked pixels (those with a mask value of 0) are not relevant and will be replaced by an extrapolation based on the other pixels.

The inpainting parameters depend on the Method value:

  • Normalized convolution This method uses smoothing filters to diffuse the information in masked areas (see this tutorial). The applied filters are Gaussian or square depending on the choice in``Method``. The parameter Kernel Size defines the size in pixels of the filters to be used; its value should depend on the size of the largest masked area.