Skip to content

alphamat_infoFlow

alphamatfunctionOpenCV 5.0.0
import { alphamat_infoFlow } from '@banou/opencv-wasm'

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

Compute alpha matte of an object in an image

alphamat_infoFlow(image: Mat, tmap: Mat, result: Mat): void;
image

Input RGB image

tmap

Input greyscale trimap image

result

Output destination, filled by the native operation. Output alpha matte image

The function infoFlow performs alpha matting on a RGB image using a greyscale trimap image, and outputs a greyscale alpha matte image. The output alpha matte can be used to softly extract the foreground object from a background image. Examples can be found in the samples directory.

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.