Skip to content

composeRT

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

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

ARGUMENTSrvec1, tvec1, rvec2, tvec2
FUNCTIONcomposeRT
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Combines two rotation-and-shift transformations.

composeRT(rvec1: Mat, tvec1: Mat, rvec2: Mat, tvec2: Mat, rvec3: Mat, tvec3: Mat, dr3dr1: Mat, dr3dt1: Mat, dr3dr2: Mat, dr3dt2: Mat, dt3dr1: Mat, dt3dt1: Mat, dt3dr2: Mat, dt3dt2: Mat): void;
9 available overloads
composeRT(rvec1: Mat, tvec1: Mat, rvec2: Mat, tvec2: Mat, rvec3: Mat, tvec3: Mat): void;
composeRT(rvec1: Mat, tvec1: Mat, rvec2: Mat, tvec2: Mat, rvec3: Mat, tvec3: Mat, dr3dr1: Mat): void;
composeRT(rvec1: Mat, tvec1: Mat, rvec2: Mat, tvec2: Mat, rvec3: Mat, tvec3: Mat, dr3dr1: Mat, dr3dt1: Mat): void;
composeRT(rvec1: Mat, tvec1: Mat, rvec2: Mat, tvec2: Mat, rvec3: Mat, tvec3: Mat, dr3dr1: Mat, dr3dt1: Mat, dr3dr2: Mat): void;
composeRT(rvec1: Mat, tvec1: Mat, rvec2: Mat, tvec2: Mat, rvec3: Mat, tvec3: Mat, dr3dr1: Mat, dr3dt1: Mat, dr3dr2: Mat, dr3dt2: Mat): void;
composeRT(rvec1: Mat, tvec1: Mat, rvec2: Mat, tvec2: Mat, rvec3: Mat, tvec3: Mat, dr3dr1: Mat, dr3dt1: Mat, dr3dr2: Mat, dr3dt2: Mat, dt3dr1: Mat): void;
composeRT(rvec1: Mat, tvec1: Mat, rvec2: Mat, tvec2: Mat, rvec3: Mat, tvec3: Mat, dr3dr1: Mat, dr3dt1: Mat, dr3dr2: Mat, dr3dt2: Mat, dt3dr1: Mat, dt3dt1: Mat): void;
composeRT(rvec1: Mat, tvec1: Mat, rvec2: Mat, tvec2: Mat, rvec3: Mat, tvec3: Mat, dr3dr1: Mat, dr3dt1: Mat, dr3dr2: Mat, dr3dt2: Mat, dt3dr1: Mat, dt3dt1: Mat, dt3dr2: Mat): void;
composeRT(rvec1: Mat, tvec1: Mat, rvec2: Mat, tvec2: Mat, rvec3: Mat, tvec3: Mat, dr3dr1: Mat, dr3dt1: Mat, dr3dr2: Mat, dr3dt2: Mat, dt3dr1: Mat, dt3dt1: Mat, dt3dr2: Mat, dt3dt2: Mat): void;
rvec1

First rotation vector.

tvec1

First translation vector.

rvec2

Second rotation vector.

tvec2

Second translation vector.

rvec3

Output destination, filled by the native operation. Output rotation vector of the superposition.

tvec3

Output destination, filled by the native operation. Output translation vector of the superposition.

dr3dr1

Output destination, filled by the native operation. Optional output derivative of rvec3 with regard to rvec1

dr3dt1

Output destination, filled by the native operation. Optional output derivative of rvec3 with regard to tvec1

dr3dr2

Output destination, filled by the native operation. Optional output derivative of rvec3 with regard to rvec2

dr3dt2

Output destination, filled by the native operation. Optional output derivative of rvec3 with regard to tvec2

dt3dr1

Output destination, filled by the native operation. Optional output derivative of tvec3 with regard to rvec1

dt3dt1

Output destination, filled by the native operation. Optional output derivative of tvec3 with regard to tvec1

dt3dr2

Output destination, filled by the native operation. Optional output derivative of tvec3 with regard to rvec2

dt3dt2

Output destination, filled by the native operation. Optional output derivative of tvec3 with regard to tvec2

The functions compute:

\begin{array}{l} \texttt{rvec3} =  \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} )  \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right )  \\ \texttt{tvec3} =  \mathrm{rodrigues} ( \texttt{rvec2} )  \cdot \texttt{tvec1} +  \texttt{tvec2} \end{array} ,

where \mathrm{rodrigues} denotes a rotation vector to a rotation matrix transformation, and \mathrm{rodrigues}^{-1} denotes the inverse transformation. See #Rodrigues for details.

Also, the functions can compute the derivatives of the output vectors with regards to the input vectors (see #matMulDeriv ). The functions are used inside #stereoCalibrate but can also be used in your own code where Levenberg-Marquardt or another gradient-based solver is used to optimize a function that contains a matrix multiplication.

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.