Skip to content

seamlessClone

Computational photographyfunctionOpenCV 5.0.0
import { seamlessClone } from '@banou/opencv-wasm'

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

example: samples/cpp/tutorial_code/photo/seamless_cloning/cloning_demo.cpp An example using seamlessClone function example: samples/cpp/snippets/cloning_demo.cpp An example using illuminationChange, colorChange, seamlessClone, textureFlattening functions Performs seamless cloning to blend a region from a source image into a destination image. This function is designed for local image editing, allowing changes restricted to a region (manually selected as the ROI) to be applied effortlessly and seamlessly. These changes can range from slight distortions to complete replacement by novel content [PM03].

seamlessClone(src: Mat, dst: Mat, mask: Mat, p: Point, blend: Mat, flags: number): void;
src

The source image (8-bit 3-channel), from which a region will be blended into the destination.

dst

The destination image (8-bit 3-channel), where the src image will be blended.

mask

A binary mask (8-bit, 1, 3, or 4-channel) specifying the region in the source image to blend. Non-zero pixels indicate the region to be blended. If an empty Mat is provided, a mask with all non-zero pixels is created internally.

p

The point where the center of the src image is placed in the dst image.

blend

Output destination, filled by the native operation. The output image that stores the result of the seamless cloning. It has the same size and type as dst.

flags

Flags that control the type of cloning method, can take values of cv::SeamlessCloneFlags.

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.