This repository has been archived on 2026-07-09. You can view files and clone it, but cannot push or open issues or pull requests.
agent-knowledge-base-archived/problems/2026-05-24-projectionmapping-stereo-top-bottom-calibration-failure.md

4.4 KiB

ProjectionMapping Calibration Fails With Stereo Top/Bottom Projector Output

Symptoms

During projector calibration in the ProjectionMapping tool, solver initialization failed with repeated messages:

Could not choose a unique projector pose seed. Scores: 0, 0, 0, 0

Earlier attempts also produced:

More or fewer than one combination is valid

Pattern capture folders existed, but captured frames appeared not to contain useful gray-code differences.

Later on 2026-05-24, after moving to C:\git\ProjectionMapping-webcam and using Kinect 2.0 with manual RGB alignment, pattern frames did contain visible gray-code differences, but the same seed failure remained:

Could not choose a unique projector pose seed. Scores: 0, 0, 0, 0

The app then crashed in ucrtbase.dll with Windows exception 0xc0000409, likely from an assert/abort path after failed calibration.

Environment

  • Machine: wuu
  • Project: garage
  • Local repository: C:\git\ProjectionMapping
  • Later working copy: C:\git\ProjectionMapping-webcam (not a Git repository)
  • Tool: DirectX12 ProjectionMapping app
  • Hardware context: two projector/monitor outputs; user reported projectors were running in stereo top/bottom mode.
  • Later working state: two Optoma displays marked as projectors, Kinect 2.0 RGB/depth ready, screenMerc3.fbx manually aligned with the Kinect RGB overlay.

Root Cause

The calibration code assumes that a projector receives and displays a full-frame calibration pattern. In stereo top/bottom output, a single display frame contains two stacked stereo regions. If full-frame gray-code patterns are sent into that layout, the physical projected pixels no longer correspond to the coordinates expected by the calibration decoder.

This can make captured pattern images look nearly unchanged or decode to ambiguous/zero scores, so the solver cannot choose a unique projector pose seed.

If captured frames do show clear gray-code differences but pose seed still fails, the problem has moved downstream: decoded camera/projector correspondences are probably not landing on valid rendered model pixels, or the model/camera/projector coordinate assumptions are inconsistent. In that case, inspect the number of decoded correspondences that survive the rendered model mask before running Ceres.

Solution Direction

Do not trust projector calibration results until output layout is explicit.

Add projector output layout support before calibration:

  • Full frame.
  • Stereo top/bottom.
  • Stereo left/right.
  • Per-region pattern generation.
  • Per-region coordinate mapping from captured gray-code values back to projector pixels.

For a first recovery pass, disable stereo layout and calibrate one full-frame projector region if the hardware allows it. If stereo cannot be disabled, crop or target the correct top/bottom region during pattern generation and decoding.

For the ProjectionMapping-webcam Kinect/manual alignment pass, the immediate recovery path is:

  1. Mark only one Optoma as Is projector.
  2. Clear pattern captures.
  3. Capture patterns for that single projector.
  4. Run calibration and inspect the new diagnostic log:
Projector '<id>' seed correspondences: decoded=<n>, on model=<n>

If decoded is high but on model is low, fix manual object alignment, model scale/orientation, camera view/intrinsics, or the rendered point-cloud mask before changing solver settings. If both are high but pose seed still scores 0,0,0,0, inspect coordinate handedness/orientation and projector/camera intrinsics.

Verification

Before running Ceres/solver:

  1. Capture calibration patterns.
  2. Inspect calibration_temp.
  3. Compare image0000, image0001, and several later gray-code frames.
  4. Confirm visible black/white or gray-code changes appear in the camera captures.
  5. Only then run projector calibration.

If pattern frames are nearly identical, fix projection/capture/layout first; solver changes will not help.

For the later ProjectionMapping-webcam run, contact-sheet inspection of calibration_temp\Sun_May_24_20.58.26_2026 showed visible vertical and horizontal gray-code stripes in both projector capture folders, so the next blocker was not "no projected pattern" but correspondence/geometry validity.

  • C:\git\ProjectionMapping\AGENTS.md
  • C:\git\ProjectionMapping-master\AGENTS.md
  • C:\git\ProjectionMapping-webcam\src\calibration\calibration.cpp
  • projects/garage/repositories.md
  • locations/wuu.md