Nodes/comfyui_cv/CV Matrix To Pose
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.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Matrix To Pose
  • matrix
  • rvec
  • tvec
  • rotation
  • scale
  • found
Categoryimage/CV/features

Inputs (1)

NameTypeDefaultDescription
matrixNPARRAY4x4 homogeneous or 3x4 [R|t] transform. A 3x3 rotation on its own is accepted too and gives a zero translation.

Outputs (5)

NameTypeDescription
rvecNPARRAY3x1 Rodrigues rotation vector.
tvecNPARRAY3x1 translation vector, in the matrix's own units.
rotationNPARRAYThe orthonormalized 3x3 rotation matrix R.
scaleFLOATMean 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.
foundBOOLEANFalse when the matrix was missing, the wrong shape, or non-finite.