OpenCV decomposeProjectionMatrix_1
The Twin That Splits a Camera Matrix Into Seven Outputs
- projMatrix
- cameraMatrix
- rotMatrix
- transVect
- rotMatrixX
- rotMatrixY
- rotMatrixZ
- eulerAngles
- nparray_0
- nparray_1
- nparray_2
- nparray_3
- nparray_4
- nparray_5
- nparray_6
OpenCV decomposeProjectionMatrix_1 is the overload twin of decomposeProjectionMatrix_0 - same cv2.decomposeProjectionMatrix call, same seven outputs, no difference you'll ever feel. The _1 suffix is the usual codegen artifact: geroldmeisinger/opencv-comfyui makes a node per overload in cv2's type stubs, so MatLike and UMat signatures each get one. ComfyUI can't distinguish them, so you can't go wrong.
What it's for
Camera calibration and pose math. Feed it a 3×4 projection matrix P and it decomposes into the intrinsic cameraMatrix, the world-to-camera rotMatrix and transVect, per-axis rotation matrices, and eulerAngles - i.e., "where is the camera, which way does it point, and what does the lens do." It's a niche, non-generative node that exists because the pack wraps every top-level cv2 function. Unless you're building pose/AR/3D-reconstruction pipelines inside ComfyUI, you likely won't need it.
Inputs and outputs
projMatrix(NPARRAY) - the 3×4 projection matrix (float matrix, not an image).cameraMatrix,rotMatrix,transVect,rotMatrixX/Y/Z,eulerAngles(NPARRAY, optional) - out-parameters; leave them unconnected.nparray_0throughnparray_6(outputs) - intrinsics, rotation, translation, axis rotations, Euler angles, in order.
Install
ComfyUI Manager (search opencv-comfyui) or:
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-contrib-python
Restart ComfyUI. No models. The package is opencv-contrib-python (not the README's swapped opencv-python-contrib); conflicting installs announce themselves via the guidedFilter import error, fixed as documented in the LayerStyle issue the README links.
As with the twin, all seven outputs are float matrices, not pictures - previewing them as images produces garbage or the 'NoneType' object has no attribute 'shape' error. Route them to downstream camera nodes. Full detail lives in the decomposeProjectionMatrix_0 article.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| projMatrix | NPARRAY | — | |
| cameraMatrixopt | NPARRAY | — | |
| rotMatrixopt | NPARRAY | — | |
| transVectopt | NPARRAY | — | |
| rotMatrixXopt | NPARRAY | — | |
| rotMatrixYopt | NPARRAY | — | |
| rotMatrixZopt | NPARRAY | — | |
| eulerAnglesopt | NPARRAY | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| nparray_0 | NPARRAY | — |
| nparray_1 | NPARRAY | — |
| nparray_2 | NPARRAY | — |
| nparray_3 | NPARRAY | — |
| nparray_4 | NPARRAY | — |
| nparray_5 | NPARRAY | — |
| nparray_6 | NPARRAY | — |