Skip to content

Add fixed-calibration THIN_PRISM_FISHEYE support for Caspar BA - #4657

Draft
DuVogel87 wants to merge 4 commits into
colmap:mainfrom
DuVogel87:caspar-thin-prism-fisheye-minimal-v3-20260826
Draft

Add fixed-calibration THIN_PRISM_FISHEYE support for Caspar BA#4657
DuVogel87 wants to merge 4 commits into
colmap:mainfrom
DuVogel87:caspar-thin-prism-fisheye-minimal-v3-20260826

Conversation

@DuVogel87

@DuVogel87 DuVogel87 commented Aug 26, 2026

Copy link
Copy Markdown

Summary

Adds draft THIN_PRISM_FISHEYE support to the Caspar bundle-adjustment backend for narrow fixed-calibration rig BA cases.

Supported scope in this PR:

  • THIN_PRISM_FISHEYE
  • fixed intrinsics
  • fixed sensor_from_rig
  • optimized points3D
  • fixed-pose / points-only BA through the standalone/default bundle adjuster path
  • active rig/image pose + points BA with fixed calibration through the standalone/default bundle adjuster path
  • f32 generated Caspar kernels, with f64 kernels generated as well

Unsupported THIN_PRISM combinations fail explicitly instead of silently skipping observations.

Important scope note: this draft does not claim incremental mapper / local BA support for THIN_PRISM_FISHEYE yet. The incremental mapper can exercise additional local-BA gauge and fixed-variable combinations that are outside the narrow generated factor set in this PR.

Motivation

Caspar currently supports only a limited set of camera models. This PR adds fixed-calibration THIN_PRISM_FISHEYE rig factors for calibrated fisheye rigs.

The first use case is points-only BA after reconstruction. The second use case is fixed-intrinsics pose+point BA, which is closer to full BA while still avoiding variable intrinsics and sensor-from-rig refinement.

Implementation notes

COLMAP parameter order:

fx, fy, cx, cy, k1, k2, p1, p2, k3, k4, sx1, sy1

Caspar split constant layout:

principal_point = [cx, cy]
focal_and_extra = [fx, fy, k1, k2, p1, p2, k3, k4, sx1, sy1]

Projection follows COLMAP THIN_PRISM_FISHEYE behavior:

  1. normalize pinhole coordinates,
  2. apply fisheye theta = atan(r) mapping,
  3. apply radial/tangential/thin-prism distortion in fisheye coordinates uu,vv,
  4. project to pixels.

The branch currently contains four logical commits:

  1. adapter/generator/test wiring for fixed-pose points-only support,
  2. generated fixed-pose kernels,
  3. fixed-calibration active-pose + point support with generated kernels,
  4. draft diagnostics: a Caspar BriefReport() and an explicit unsupported THIN_PRISM three-point gauge test.

Tests

f32:

cmake -S . -B build-minimal-pr-v3-cuda-ceres-tests -GNinja \
  -DCMAKE_BUILD_TYPE=Release \
  -DCUDA_ENABLED=ON \
  -DCMAKE_CUDA_ARCHITECTURES=86 \
  -DCASPAR_ENABLED=ON \
  -DCASPAR_USE_DOUBLE=OFF \
  -DTESTS_ENABLED=ON \
  -DGUI_ENABLED=OFF \
  -DCeres_DIR=/home/ubu/dev/src/ceres-cuda/install/lib/cmake/Ceres
cmake --build build-minimal-pr-v3-cuda-ceres-tests --target bundle_adjustment_caspar_test -j 10
./build-minimal-pr-v3-cuda-ceres-tests/src/colmap/estimators/bundle_adjustment_caspar_test

Result: 22/22 passed.

f64 THIN_PRISM-specific tests:

cmake -S . -B build-minimal-pr-v3-cuda-ceres-tests-f64 -GNinja \
  -DCMAKE_BUILD_TYPE=Release \
  -DCUDA_ENABLED=ON \
  -DCMAKE_CUDA_ARCHITECTURES=86 \
  -DCASPAR_ENABLED=ON \
  -DCASPAR_USE_DOUBLE=ON \
  -DTESTS_ENABLED=ON \
  -DGUI_ENABLED=OFF \
  -DCeres_DIR=/home/ubu/dev/src/ceres-cuda/install/lib/cmake/Ceres
cmake --build build-minimal-pr-v3-cuda-ceres-tests-f64 --target bundle_adjustment_caspar_test -j 10
./build-minimal-pr-v3-cuda-ceres-tests-f64/src/colmap/estimators/bundle_adjustment_caspar_test --gtest_filter='DefaultBundleAdjuster.ThinPrismFisheye*'

Result: 5/5 THIN_PRISM tests passed.

A previous full f64 local run still had two non-THIN merged-calibration failures in this environment, so this remains a draft for review rather than ready-to-merge.

Limitations

This PR intentionally does not add:

  • incremental mapper / local BA support for THIN_PRISM_FISHEYE,
  • variable THIN_PRISM intrinsics,
  • refine_sensor_from_rig,
  • active pose with fixed points only,
  • pose tangent component masks,
  • full Target-B gauge/mask research machinery,
  • a full THIN_PRISM factor-family expansion.

This is a narrow fixed-calibration implementation, not a complete Caspar THIN_PRISM feature set.

@DuVogel87 DuVogel87 changed the title Add minimal THIN_PRISM_FISHEYE support for Caspar points-only BA Add fixed-calibration THIN_PRISM_FISHEYE support for Caspar BA Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant