Skip to content

findTransformECC1

Motion and trackingfunctionOpenCV 5.0.0
import { findTransformECC1 } from '@banou/opencv-wasm'

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

ARGUMENTStemplateImage, inputImage, warpMatrix, motionType
FUNCTIONfindTransformECC1
RETURN TYPEnumber
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

example: samples/cpp/image_alignment.cpp An example using the image alignment ECC algorithm Finds the geometric transform (warp) between two images in terms of the ECC criterion [EP08] .

See: computeECC, estimateAffine2D, estimateAffinePartial2D, findHomography

findTransformECC1(templateImage: Mat, inputImage: Mat, warpMatrix: Mat, motionType: number, criteria: TermCriteria, inputMask: Mat): number;
4 available overloads
findTransformECC1(templateImage: Mat, inputImage: Mat, warpMatrix: Mat): number;
findTransformECC1(templateImage: Mat, inputImage: Mat, warpMatrix: Mat, motionType: number): number;
findTransformECC1(templateImage: Mat, inputImage: Mat, warpMatrix: Mat, motionType: number, criteria: TermCriteria): number;
findTransformECC1(templateImage: Mat, inputImage: Mat, warpMatrix: Mat, motionType: number, criteria: TermCriteria, inputMask: Mat): number;
templateImage

1 or 3 channel template image; CV_8U, CV_16U, CV_32F, CV_64F type.

inputImage

input image which should be warped with the final warpMatrix in order to provide an image similar to templateImage, same type as templateImage.

warpMatrix

Input/output value, modified by the native operation. floating-point 2\times 3 or 3\times 3 mapping matrix (warp).

motionType

parameter, specifying the type of motion:

  • MOTION_TRANSLATION sets a translational motion model; warpMatrix is 2\times 3 with the first 2\times 2 part being the unity matrix and the rest two parameters being estimated.
  • MOTION_EUCLIDEAN sets a Euclidean (rigid) transformation as motion model; three parameters are estimated; warpMatrix is 2\times 3.
  • MOTION_AFFINE sets an affine motion model (DEFAULT); six parameters are estimated; warpMatrix is 2\times 3.
  • MOTION_HOMOGRAPHY sets a homography as a motion model; eight parameters are estimated;`warpMatrix` is 3\times 3.
criteria

parameter, specifying the termination criteria of the ECC algorithm; criteria.epsilon defines the threshold of the increment in the correlation coefficient between two iterations (a negative criteria.epsilon makes criteria.maxcount the only termination criterion). Default values are shown in the declaration above.

inputMask

An optional single channel mask to indicate valid values of inputImage.

Returns

The number result.

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.