OpenCV composeRT_0
Compose two rotations and translations (composeRT_0)
- rvec1
- tvec1
- rvec2
- tvec2
- rvec3
- tvec3
- dr3dr1
- dr3dt1
- dr3dr2
- dr3dt2
- dt3dr1
- dt3dt1
- dt3dr2
- dt3dt2
- nparray_0
- nparray_1
- nparray_2
- nparray_3
- nparray_4
- nparray_5
- nparray_6
- nparray_7
- nparray_8
- nparray_9
This one's for the 3D-vision people. composeRT_0 wraps cv2.composeRT, which takes two rigid-body transformations - each a rotation + translation - and composes them into one. If you're doing camera calibration, pose estimation, stereo rig math, or anything where "where is the camera relative to the world" gets chained together, this is a real tool. If you're making pretty pictures, you can safely scroll past; there's nothing visual here at all.
What it does
In OpenCV, a camera pose is a rotation vector (rvec, a 3×1 Rodrigues vector - not a 3×3 matrix) plus a translation vector (tvec, 3×1). Compose two of them, and the result is:
- rvec3 -
R = R1 * R2(rotate by 2, then by 1) - tvec3 -
t = R1 * t2 + t1
Think of it as matrix multiplication for poses: if (rvec1, tvec1) moves you from frame A to B and (rvec2, tvec2) from B to C, the composed pair moves you straight from A to C. That's the whole point of the node.
The inputs and outputs
- rvec1 / rvec2 (NPARRAY) - rotation vectors (3×1 each).
- tvec1 / tvec2 (NPARRAY) - translation vectors (3×1 each).
- The eight optional
dr3…/dt3…inputs - these are Jacobian out-parameters (how the result changes as each input nudges), used for error propagation in calibration. The README says to skip the optional out-params, and for a beginner that's exactly right. Leave them alone.
Outputs - all ten of them: nparray_0 (rvec3), nparray_1 (tvec3), then eight derivative matrices (nparray_2 through nparray_9). For most work you only care about the first two; the derivatives are there because calibration code needs them. There's no named output for "the composed pose" - it's nparray_0 and nparray_1, and that's your answer.
When this shows up in a real workflow
Honestly, composeRT_0 is about as deep into computer-vision math as this pack goes. The realistic scenario is a 3D-reconstruction or pose pipeline: you've estimated camera extrinsics with solvePnP (also in the pack), you want to chain relative poses into an absolute trajectory, and you reach for this. In pure ComfyUI image-gen land it's rare - but if you're experimenting with novel-view synthesis or camera-rig math, having it wired in beats leaving your graph to run Python on the side.
Install and gotchas
Same pack as everything else: ComfyUI Manager (search "opencv-comfyui") or
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
Requires opencv-python-contrib. The practical gotchas: rotation vectors must be Rodrigues vectors, not 3×3 matrices (a shape mismatch will surface as a cryptic assertion); and these are pure nparray inputs, so if you're feeding data in from an image pipeline, convert with Image2Nparray first - though realistically your rvec/tvec will come from other math nodes, not from images at all.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| rvec1 | NPARRAY | — | |
| tvec1 | NPARRAY | — | |
| rvec2 | NPARRAY | — | |
| tvec2 | NPARRAY | — | |
| rvec3opt | NPARRAY | — | |
| tvec3opt | NPARRAY | — | |
| dr3dr1opt | NPARRAY | — | |
| dr3dt1opt | NPARRAY | — | |
| dr3dr2opt | NPARRAY | — | |
| dr3dt2opt | NPARRAY | — | |
| dt3dr1opt | NPARRAY | — | |
| dt3dt1opt | NPARRAY | — | |
| dt3dr2opt | NPARRAY | — | |
| dt3dt2opt | NPARRAY | — |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| nparray_0 | NPARRAY | — |
| nparray_1 | NPARRAY | — |
| nparray_2 | NPARRAY | — |
| nparray_3 | NPARRAY | — |
| nparray_4 | NPARRAY | — |
| nparray_5 | NPARRAY | — |
| nparray_6 | NPARRAY | — |
| nparray_7 | NPARRAY | — |
| nparray_8 | NPARRAY | — |
| nparray_9 | NPARRAY | — |