composeRT
import { composeRT } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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;rvec1First rotation vector.
tvec1First translation vector.
rvec2Second rotation vector.
tvec2Second translation vector.
rvec3Output destination, filled by the native operation. Output rotation vector of the superposition.
tvec3Output destination, filled by the native operation. Output translation vector of the superposition.
dr3dr1Output destination, filled by the native operation. Optional output derivative of rvec3 with regard to rvec1
dr3dt1Output destination, filled by the native operation. Optional output derivative of rvec3 with regard to tvec1
dr3dr2Output destination, filled by the native operation. Optional output derivative of rvec3 with regard to rvec2
dr3dt2Output destination, filled by the native operation. Optional output derivative of rvec3 with regard to tvec2
dt3dr1Output destination, filled by the native operation. Optional output derivative of tvec3 with regard to rvec1
dt3dt1Output destination, filled by the native operation. Optional output derivative of tvec3 with regard to tvec1
dt3dr2Output destination, filled by the native operation. Optional output derivative of tvec3 with regard to rvec2
dt3dt2Output 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.