Skip to content

xphoto_inpaint

xphotofunctionOpenCV 5.0.0
import { xphoto_inpaint } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSsrc, mask, dst, algorithmType
FUNCTIONxphoto_inpaint
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

The function implements different single-image inpainting algorithms.

See the original papers [He2012] (Shiftmap) or [GenserPCS2018] and [SeilerTIP2015] (FSR) for details.
xphoto_inpaint(src: Mat, mask: Mat, dst: Mat, algorithmType: number): void;
src

source image

  • #INPAINT_SHIFTMAP: it could be of any type and any number of channels from 1 to 4. In case of

3- and 4-channels images the function expect them in CIELab colorspace or similar one, where first color component shows intensity, while second and third shows colors. Nonetheless you can try any colorspaces.

  • #INPAINT_FSR_BEST or #INPAINT_FSR_FAST: 1-channel grayscale or 3-channel BGR image.
mask

mask (#CV_8UC1), where non-zero pixels indicate valid image area, while zero pixels indicate area to be inpainted

dst

destination image

algorithmType

see xphoto::InpaintTypes

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.