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 p∼PXp \sim P X rearranges into two linear rows in the 12 unknowns of PP:

−X p11−Y p12−Z p13−p14+u X p31+u Y p32+u Z p33+u p34=0−X p21−Y p22−Z p23−p24+v X p31+v Y p32+v Z p33+v p34=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 P∈R3×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[R∣t]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:3←P:,1:3 RΔP_{:,1:3} \leftarrow P_{:,1:3}\,R_\Delta, so the delta acts on incoming LiDAR points.
  • Pixel shift: add Δu P3,:\Delta u\,P_{3,:} to row 0 and Δv P3,:\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 u↦u+Δ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[R∣t]P = K_{\text{runtime}}[R \mid t]
Failure modeBad clicks / sparse geometryBad planes, labeling consensus, observability

Feature-branch math: extrinsics, projection.