decomposeProjectionMatrix function
(Mat, Mat, Mat)
decomposeProjectionMatrix(
- Mat projMatrix, {
- OutputArray? cameraMatrix,
- OutputArray? rotMatrix,
- OutputArray? transVect,
- OutputArray? rotMatrixX,
- OutputArray? rotMatrixY,
- OutputArray? rotMatrixZ,
- OutputArray? eulerAngles,
Decomposes a projection matrix into a rotation matrix and a camera intrinsic matrix.
void cv::decomposeProjectionMatrix (InputArray projMatrix, OutputArray cameraMatrix, OutputArray rotMatrix, OutputArray transVect, OutputArray rotMatrixX=noArray(), OutputArray rotMatrixY=noArray(), OutputArray rotMatrixZ=noArray(), OutputArray eulerAngles=noArray())
https://docs.opencv.org/4.11.0/d9/d0c/group__calib3d.html#gaaae5a7899faa1ffdf268cd9088940248
Implementation
(Mat cameraMatrix, Mat rotMatrix, Mat transVect) decomposeProjectionMatrix(
Mat projMatrix, {
OutputArray? cameraMatrix,
OutputArray? rotMatrix,
OutputArray? transVect,
OutputArray? rotMatrixX,
OutputArray? rotMatrixY,
OutputArray? rotMatrixZ,
OutputArray? eulerAngles,
}) {
cameraMatrix ??= Mat.empty();
rotMatrix ??= Mat.empty();
transVect ??= Mat.empty();
rotMatrixX ??= Mat.empty();
rotMatrixY ??= Mat.empty();
rotMatrixZ ??= Mat.empty();
eulerAngles ??= Mat.empty();
cvRun(
() => ccalib3d.cv_decomposeProjectionMatrix(
projMatrix.ref,
cameraMatrix!.ref,
rotMatrix!.ref,
transVect!.ref,
rotMatrixX!.ref,
rotMatrixY!.ref,
rotMatrixZ!.ref,
eulerAngles!.ref,
ffi.nullptr,
),
);
return (cameraMatrix, rotMatrix, transVect);
}