Skip to content

estimateAffine3D1

geometryfunctionOpenCV 5.0.0
import { estimateAffine3D1 } from '@banou/opencv-wasm'

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

ARGUMENTSsrc, dst, force_rotation
FUNCTIONestimateAffine3D1
RETURN TYPEestimateAffine3D1Result
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Computes an optimal affine transformation between two 3D point sets.

It computes R,s,t minimizing \sum{i} dst_i - c \cdot R \cdot src_i where R is a 3x3 rotation matrix, t is a 3x1 translation vector and s is a scalar size value. This is an implementation of the algorithm by Umeyama [umeyama1991least] . The estimated affine transform has a homogeneous scale which is a subclass of affine transformations with 7 degrees of freedom. The paired point sets need to comprise at least 3 points each.

estimateAffine3D1(src: Mat, dst: Mat, force_rotation: boolean): estimateAffine3D1Result;
2 available overloads
estimateAffine3D1(src: Mat, dst: Mat): estimateAffine3D1Result;
estimateAffine3D1(src: Mat, dst: Mat, force_rotation: boolean): estimateAffine3D1Result;
src

First input 3D point set.

dst

Second input 3D point set.

force_rotation

If true, the returned rotation will never be a reflection. This might be unwanted, e.g. when optimizing a transform between a right- and a left-handed coordinate system.

Returns

3D affine transformation matrix 3 \times 4 of the form

T =
\begin{bmatrix}
R & t\\
\end{bmatrix}

``` Scalar output parameters are returned as named fields in this object. Release returned native handles with using or delete(), including handles nested in results.

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.