Skip to content

Legacy DLT

On prod today, extrinsics are often still produced with calibrate.py: click image pixels, enter matching LiDAR (x,y,z)(x,y,z), solve a free 3×4 projection matrix by Direct Linear Transform (DLT), write projection_matrix_{l|r}.

For each correspondence (X,Y,Z)(u,v)(X,Y,Z) \leftrightarrow (u,v), the homogeneous model pPXp \sim P X rearranges into two linear rows in the 12 unknowns of PP:

Xp11Yp12Zp13p14+uXp31+uYp32+uZp33+up34=0Xp21Yp22Zp23p24+vXp31+vYp32+vZp33+vp34=0\begin{aligned} &-X\,p_{11} - Y\,p_{12} - Z\,p_{13} - p_{14} + u\,X\,p_{31} + u\,Y\,p_{32} + u\,Z\,p_{33} + u\,p_{34} = 0 \\ &-X\,p_{21} - Y\,p_{22} - Z\,p_{23} - p_{24} + v\,X\,p_{31} + v\,Y\,p_{32} + v\,Z\,p_{33} + v\,p_{34} = 0 \end{aligned}

Stack ≥6 point pairs (the script asks for more; default minimum is 10), take the SVD of the design matrix, and reshape the singular vector for the smallest singular value into PR3×4P \in \mathbb{R}^{3\times4}. Hartley normalization helpers exist in the file but are commented out in the current solve path.

Unlike the feature-branch path, this PP is not forced to equal K[Rt]K[R \mid t] for a particular KK. The free PP can absorb extrinsic error, residual distortion, and click noise in one matrix.

dlt_proj_adjuster.py fine-tunes an existing PP:

  • Rotation: right-multiply the left 3×3 block: P:,1:3P:,1:3RΔP_{:,1:3} \leftarrow P_{:,1:3}\,R_\Delta, so the delta acts on incoming LiDAR points.
  • Pixel shift: add ΔuP3,:\Delta u\,P_{3,:} to row 0 and ΔvP3,:\Delta v\,P_{3,:} to row 1. Because u=(P1,:X)/(P3,:X)u = (P_{1,:}X)/(P_{3,:}X), that yields a depth-independent pixel offset uu+Δuu \mapsto u + \Delta u (same for vv).

Runs after calibrate.py for small rotation and pixel-offset corrections.

Click DLT (calibrate.py)Multi-pose board (calibrate_extrinsics.py)
StatusCommon on prodfeature/perc/physical-calibration
InputsManual 3D–2D pairsSynced images + dense /lidar_points
ModelFree PPP=Kruntime[Rt]P = K_{\text{runtime}}[R \mid t]
Failure modeBad clicks / sparse geometryBad planes, labeling consensus, observability

Feature-branch math: extrinsics, projection.