﻿# KITTI with pykitti: a rectified-camera transform is not just the raw lidar extrinsic

Trace the pykitti calibration composition for the selected KITTI camera before projecting lidar points onto rectified images or composing another rectification twice.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-kitti-pykitti-rectified-camera-transform-not-raw-extrinsic/
Language: en

## Name the destination camera representation

A KITTI overlay projects lidar points near the correct objects but remains systematically displaced. The pipeline combines a library-provided camera transform with a rectification matrix copied from a calibration example. Before adjusting the projection empirically, identify the destination frame already represented by the library. A raw camera extrinsic, a rectified reference camera and a selected stereo camera are related representations, but their matrices cannot be substituted or multiplied indiscriminately merely because their dimensions agree.

## Preserve the selected sensor context

The [official KITTI setup page](https://www.cvlibs.net/datasets/kitti/setup.php) describes the sensor arrangement and notes that rectification changes camera imagery. Select the actual camera stream and its corresponding calibration rather than treating all camera images as a single generic view. The monochrome and color stereo observations come from different sensor positions. A projection can look approximately correct while still using the wrong camera geometry, especially for distant surfaces where an offset produces a less obvious visual error.

## Inspect the library’s frame notation

The [pykitti documentation](https://raw.githubusercontent.com/utiasSTARS/pykitti/master/README.md) defines transforms by destination and origin frame and requires associated calibration files. Retain that convention in an adapter rather than interpreting a variable name through another library’s notation. A transformation that maps lidar coordinates into a camera frame is not its inverse. Keep the source sequence’s calibration with the derived cache, and do not treat a readable image directory as proof that a compatible calibration archive was selected.

## Trace rectification and camera offset composition

The [raw-data loader implementation](https://raw.githubusercontent.com/utiasSTARS/pykitti/master/pykitti/raw.py) composes rectification and camera-specific offsets when constructing camera transforms. Inspect that construction for the version actually used. Adding the same rectification again can produce a numerically valid matrix with incorrect meaning. Likewise, dropping the selected camera offset changes which camera receives the projected points. Record whether the downstream function expects lidar coordinates, rectified camera coordinates or already projected image coordinates before attaching another transformation stage.

## Validate the chain without empirical compensation

Choose visible structural edges, project a limited lidar subset and inspect whether the declared chain aligns across nearby and distant surfaces. Preserve image resolution and any later crop independently of the extrinsic chain. [Image coordinate guidance](/journal/data-guide-image-exif-box-coordinate/) supports projection checks; [software reproducibility](/journal/software-stack-reproducibility/) preserves loader behavior. Correct the representation contract rather than adding an unexplained image offset, so a convincing overlay reflects the selected calibration instead of compensating for a duplicated or omitted transformation.
