Nodes/comfyui_cv/CV Trajectory Error (ATE / RPE)
ComfyUI Node

CV Trajectory Error (ATE / RPE)

Scores one trajectory against another, index for index - the standard way an odometry or SLAM result is compared with ground truth. ATE (absolute trajectory error) is the distance between corresponding points after the two tracks have been brought into one frame; RPE (relative pose error) is the disagreement between consecutive STEPS, which sees local noise that a globally-fitted ATE hides. Alignment matters: two odometry runs start in their own coordinate frames, and a monocular run has no scale at all, so comparing raw coordinates measures the arbitrary choice of frame instead of the estimate. 'rigid (SE3)' removes the rotation and offset; 'similarity (Sim3)' also removes one global scale factor and is the honest setting for a monocular result (report the fitted 'scale' with it). Uses the Umeyama fit (cv2.estimateAffine3D, force_rotation) - the same one behind 'CV Register Point Clouds (3D)'. Failure-tolerant: fewer than 3 usable pairs returns found=false with zeroed metrics and the estimate passed through unaligned.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Trajectory Error (ATE / RPE)
  • estimate
  • reference
  • aligned
  • errors
  • ate_rmse
  • ate_mean
  • ate_max
  • scale
  • rpe_rmse
  • found
alignsimilarity (Sim3, monocular scale-free)
rpe_step1
Categoryimage/CV/features

Inputs (4)

NameTypeDefaultDescription
estimateNPARRAYThe trajectory being scored, Nx3 (from 'CV Visual Odometry (Sequence)' or 'CV Compose Pose').
referenceNPARRAYThe trajectory to score AGAINST, Nx3, one row per estimate row. The longer one is truncated.
alignCOMBOsimilarity (Sim3, monocular scale-free)How much of the difference to treat as a choice of coordinate frame rather than error. 'none' compares raw coordinates (only meaningful when both already share a frame AND a scale). 'rigid (SE3)' fits rotation + translation. 'similarity (Sim3)' also fits one global scale - required for monocular odometry, which recovers shape but not size.
rpe_stepINT11–10000Frame gap the relative-pose error is measured over. 1 compares frame-to-frame motion; a larger gap reports drift over that window instead.

Outputs (8)

NameTypeDescription
alignedNPARRAYThe estimate mapped into the reference's frame, Nx3 - draw this on top of the reference, not the raw input.
errorsNPARRAY(N,) float64 per-point ATE distance. Chart it against the frame index to see WHERE the drift happened.
ate_rmseFLOATRoot-mean-square ATE, in the reference's unit.
ate_meanFLOAT
ate_maxFLOATWorst single-point error - the drift at its peak.
scaleFLOATThe global scale the alignment had to apply (1.0 for 'none' and 'rigid'). Far from 1 with Sim3 means the estimate's size is off even though its shape may be right.
rpe_rmseFLOATRoot-mean-square relative-pose error over 'rpe_step' frames, after alignment.
foundBOOLEAN