ComfyUI Node
CV Matrix To Pose
Takes a 4x4 (or 3x4) rigid transform apart into the rvec + tvec that cv2.projectPoints, 'CV Rasterize Mesh' and 'CV Camera Pose To 3D View' ask for - the inverse of 'CV Pose To Matrix'. This is what turns the pose a 3D matcher produces ('CV PPF Pose Estimation', 'CV ICP Register', 'CV Register Point Clouds (3D)') back into something that can be RENDERED, so a recovered pose can be checked against, or composited into, the picture it came from. The rotation block is orthonormalized through an SVD first, so a matrix that picked up drift from a chain of multiplications still yields a valid rotation. Failure tolerant: a missing, wrongly-shaped or non-finite matrix gives a zero pose (identity rotation at the origin) with found=false.
CV Matrix To Pose
- matrix
- rvec
- tvec
- rotation
- scale
- found
Categoryimage/CV/features
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| matrix | NPARRAY | 4x4 homogeneous or 3x4 [R|t] transform. A 3x3 rotation on its own is accepted too and gives a zero translation. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| rvec | NPARRAY | 3x1 Rodrigues rotation vector. |
| tvec | NPARRAY | 3x1 translation vector, in the matrix's own units. |
| rotation | NPARRAY | The orthonormalized 3x3 rotation matrix R. |
| scale | FLOAT | Mean singular value of the input's rotation block - 1.0 for a rigid transform. Anything else means the matrix carries a scale (or drift) that rvec/tvec CANNOT represent and that this node has divided out. |
| found | BOOLEAN | False when the matrix was missing, the wrong shape, or non-finite. |