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/projects/mapping/agent-log.md

136 KiB

Mapping Agent Log

2026-05-24 - Initial Project Capture

User introduced a new open-source application for automatic projection calibration for Unreal Engine nDisplay. Requirements, MVP scope, preferred technology stack, output formats, hardware assumptions, and initial repository structure were captured in technical-spec.md, status.md, repositories.md, and decisions.md.

Next handoff: create the repository skeleton in C:\git\mappping with CMake, OpenCV dependency wiring, USB camera abstraction, GrayCode generator, JSON session format, stub exporters, and README.

2026-05-24 - Repository Created And Pushed

Created local Git repository at C:\git\mappping and remote bare repository at ssh://wuu@192.168.1.66:22/srv/git/mapping.git. Pushed initial scaffold commit 371291f864f3186a60ec27086002c929cfc1dabd on branch main.

The scaffold includes CMake, README, AGENTS.md, apps/calibrator_cli, camera/structured-light/calibration/warp/export libraries, JSON session schema, and placeholder directories for future projector/depth/blend/preview work. CMake was not verified locally because cmake was missing from PATH.

2026-05-24 - Reference Repository List Added

User provided an expanded study list for OpenCV, OpenCV contrib, structured-light/projector-camera calibration, ArUco/ChArUco, Kinect/OAK-D/RealSense depth cameras, warp/blend, MPCDI/nDisplay, RoomAlive, Unreal nDisplay, bgfx, and openFrameworks references.

The durable list was added to the project repository as docs/reference_repositories.md and summarized in technical-spec.md. First-priority study targets are OpenCV, opencv_contrib, punpongsanon/graycode-procam-calibration, kamino410/procam-calibration, sjnarmstrong/gray-code-structured-light, RoomAliveToolkit, libfreenect2, depthai-core, ofxWarpBlend, and ChristieDigital/mpcdi.

2026-05-24 - Step 01 Hardware Probe Implemented

User connected two projectors, two USB cameras, and Kinect 2.0 and asked to proceed step by step with user verification.

Implemented first testable step in mapping commit 77b1a65:

  • calibrator_cli --list-cameras [max_index]
  • calibrator_cli --capture-camera <index> <output_png>
  • calibrator_cli --list-displays
  • Windows display enumeration through EnumDisplayDevices / EnumDisplaySettings
  • OpenCV DirectShow camera probing on Windows
  • vcpkg.json with opencv4[contrib]
  • docs/step_01_hardware_probe.md

Local configure check used Visual Studio CMake at C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe. The compiler was detected, but configure failed because OpenCVConfig.cmake was not found. Next handoff: install OpenCV/opencv_contrib or use vcpkg, build calibrator_cli, and have the user run the three hardware probe commands.

2026-05-24 - Hardware Probe Built And Verified

Installed local vcpkg at C:\git\vcpkg, bootstrapped it, and installed opencv4[contrib] through the repository manifest. Initial vcpkg install selected Visual Studio 18 and failed in libjpeg-turbo; forcing Visual Studio 2022 with VCPKG_VISUAL_STUDIO_PATH fixed it. Reusable note recorded in problems/2026-05-24-vcpkg-selects-visual-studio-18-libjpeg-turbo-failure.md.

Built mapping successfully with CMakePresets.json:

& "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --preset vs2022-vcpkg
& "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --build --preset release

Verified:

  • calibrator_cli --help
  • calibrator_cli --list-displays
  • calibrator_cli --list-cameras 10
  • calibrator_cli --capture-camera for indices 0-7
  • calibrator_cli --probe-hardware out\hardware_probe3 10, with report.json parsed by PowerShell ConvertFrom-Json
  • calibrator_cli --generate-graycode 128 72 out\smoke_patterns produced 28 frames
  • calibrator_cli --write-stubs out\smoke_exports produced session JSON, PFM warp, alpha PNG, and beta PNG

Observed hardware:

  • Active displays: primary DISPLAY1, likely projectors DISPLAY3 at (1920,0) and DISPLAY2 at (3840,0), all 1920x1080@60.
  • OpenCV camera indices 4 and 5 showed the real curved screen from two USB camera viewpoints.
  • Camera indices 0-3 were black; 6-7 were color-bar test streams.

Pushed mapping commit 77a2bc0 Build hardware probe with vcpkg.

2026-05-24 - USB Cameras Confirmed And Network Camera Added

User confirmed that out\hardware_probe\camera4.png and out\hardware_probe\camera5.png are the intended two USB cameras.

Added network snapshot camera support in mapping commit cc43e5e:

  • calibrator_cli --capture-network-camera <url|env:VAR> <output_png>
  • calibrator_cli --probe-hardware <output_dir> [max_camera_index] [network_url|env:VAR]
  • Windows implementation uses URLDownloadToFileA.
  • Reports intentionally store only image stats/status, not the network camera URL.

Verified a network snapshot camera at 192.168.1.64:

  • single snapshot capture succeeded;
  • image decoded as 1920x1080;
  • combined hardware probe with env:MAPPING_NETWORK_CAMERA_URL succeeded;
  • report.json parsed successfully with PowerShell ConvertFrom-Json.

Credentials and the full URL were not stored in project files or the knowledge base. Keep them local, for example in the MAPPING_NETWORK_CAMERA_URL environment variable.

2026-05-24 - Local Network Camera Secret File

User asked to store the network camera password in the repository for convenience on other computers. This was not done because camera credentials must not be committed.

Implemented a safe local workflow in mapping commit ae48e55:

  • .env.example is committed with placeholders.
  • .env.local is ignored by Git.
  • .gitignore excludes .env, .env.local, and *.local.env.
  • README and docs/step_01_hardware_probe.md explain how to load .env.local into PowerShell.

On the current machine, a local untracked .env.local was created and verified by capturing a network camera snapshot through env:MAPPING_NETWORK_CAMERA_URL. Do not copy its contents into Git or this knowledge base.

2026-05-24 - Step 02 Projector Pattern Output

Added projector fullscreen output in mapping commit eeb3122:

  • calibrator_cli --project-test-pattern <display_index> <white|black|red|green|blue|checker|hgradient|vgradient> [seconds]
  • calibrator_cli --project-graycode-frame <display_index> <frame_index> [seconds]
  • OpenCV highgui is now a required component.
  • docs/step_02_projector_output.md documents the expected checks.

Smoke-tested on primary display index 0:

.\build\Release\calibrator_cli.exe --project-test-pattern 0 checker 1
.\build\Release\calibrator_cli.exe --project-graycode-frame 0 0 1

Next user verification should run the same commands on projector display indices 2 (DISPLAY3, x=1920, left projector) and 1 (DISPLAY2, x=3840, right projector).

User then reported that --project-graycode-frame 2 0 10 displays a black/white stripe image, which is expected for GrayCode frame 0.

2026-05-24 - Step 03 Projected Pattern Capture

Added projected pattern capture in mapping commit 7bdb471:

.\build\Release\calibrator_cli.exe --project-and-capture <display_index> <pattern|gray:N> <output_dir> [seconds] [usb_csv] [network_url|env:VAR]

Defaults are USB cameras 4,5 and no network camera unless passed explicitly.

Smoke-tested on primary display index 0:

.\build\Release\calibrator_cli.exe --project-and-capture 0 checker out\project_capture_primary_checker 1 4,5 env:MAPPING_NETWORK_CAMERA_URL

The command captured:

  • usb_camera4.png
  • usb_camera5.png
  • network_camera.png
  • valid project_capture_report.json

Next user verification should run projected capture on projector display indices 2 and 1, then inspect whether both USB cameras see the projected GrayCode stripe.

The user ran projected capture for both displays. Captured images confirmed:

  • both projector outputs are visible to the USB cameras and network overview camera;
  • DISPLAY3/CLI index 2 projects on the left/center side of the curved screen;
  • DISPLAY2/CLI index 1 projects on the right side;
  • when only one target display was controlled, the non-target projector still showed colored content, which would contaminate calibration captures.

Added isolated capture mode in mapping commit a08b63c:

.\build\Release\calibrator_cli.exe --project-and-capture-isolated <display_index> <blank_display_csv> <pattern|gray:N> <output_dir> [seconds] [usb_csv] [network_url|env:VAR]

Smoke-tested isolated mode on primary display 0 while blanking projector display 2. Next captures should use:

.\build\Release\calibrator_cli.exe --project-and-capture-isolated 2 1 gray:0 out\project_capture_display2_gray0_isolated 5 4,5 env:MAPPING_NETWORK_CAMERA_URL
.\build\Release\calibrator_cli.exe --project-and-capture-isolated 1 2 gray:0 out\project_capture_display1_gray0_isolated 5 4,5 env:MAPPING_NETWORK_CAMERA_URL

2026-05-24 - Kinect 2.0 Windows Detection

User asked whether Kinect 2.0 is visible after connecting it.

Windows PnP detects Kinect v2 devices with status OK:

  • WDF KinectSensor Interface 0
  • Xbox NUI Sensor
  • Microphone Array (Xbox NUI Sensor)
  • USB composite device VID_045E&PID_02C4

Microsoft Kinect SDK v2 is installed at:

C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409

OpenCV --list-cameras 12 found an additional camera index 10, but captured image out\kinect_opencv_camera10.png was an OBS-style virtual camera placeholder, not Kinect RGB/depth. Next implementation step should use the Kinect SDK v2 API directly for --probe-kinect2 rather than treating Kinect as a normal OpenCV camera.

2026-05-24 - Step 04 Full GrayCode Sequence Capture

Implemented full isolated GrayCode sequence capture in mapping:

.\build\Release\calibrator_cli.exe --capture-graycode-sequence-isolated <display_index> <blank_display_csv> <output_dir> [usb_csv] [network_url|env:VAR]

The command projects every OpenCV GrayCode frame for the selected display resolution, blanks the listed non-target displays, captures USB cameras and optional network camera per frame, writes graycode_sequence_report.json, and creates contact sheets for quick visual QA.

Local verification commands:

.\build\Release\calibrator_cli.exe --capture-graycode-sequence-isolated 2 1 out\graycode_display2_sequence 4,5 env:MAPPING_NETWORK_CAMERA_URL
.\build\Release\calibrator_cli.exe --capture-graycode-sequence-isolated 1 2 out\graycode_display1_sequence 4,5 env:MAPPING_NETWORK_CAMERA_URL

Results:

  • Left projector, Windows Settings monitor 2 / DISPLAY3 / CLI index 2, blanking CLI index 1: network, usb_4, and usb_5 each captured 44/44 frames with 0 failures.
  • Right projector, Windows Settings monitor 3 / DISPLAY2 / CLI index 1, blanking CLI index 2: network, usb_4, and usb_5 each captured 44/44 frames with 0 failures.
  • Contact sheets confirm alternating vertical and horizontal GrayCode bands and show that the opposite projector side is dark during isolated capture.
  • Observed physical mapping: Windows monitor 2 / DISPLAY3 / CLI index 2 lights the left/center screen region; Windows monitor 3 / DISPLAY2 / CLI index 1 lights the right screen region.

Build verification after implementation:

cmake --build --preset release
.\build\Release\calibrator_cli.exe --help

Next step is GrayCode decoding/correspondence generation, starting with a broad-view USB camera capture as the sanity path.

2026-05-25 - Display Layout Confirmation

User provided a Windows Settings screenshot confirming the physical display layout:

  • Monitor 1: primary screen.
  • Monitor 2: left projector.
  • Monitor 3: right projector.

calibrator_cli --list-displays currently maps this to:

  • Windows monitor 1 / DISPLAY1 / CLI index 0: primary screen at (0,0).
  • Windows monitor 2 / DISPLAY3 / CLI index 2: left projector at (1920,0).
  • Windows monitor 3 / DISPLAY2 / CLI index 1: right projector at (3840,0).

Important: Windows Settings numbers, \\.\DISPLAYN suffixes, and CLI indices are not identical. Use CLI indices in commands.

2026-05-25 - Step 05 Projector Layout Verification

User pointed out that Windows can change CLI display indices and DISPLAYN names after reboot, so calibration must not rely on stale display mapping.

Implemented a pre-calibration layout check in mapping:

.\build\Release\calibrator_cli.exe --verify-projector-layout <candidate_display_csv> <output_dir> [seconds] [usb_csv] [network_url|env:VAR]

The command cycles through candidate projector outputs, shows centered display identity text plus an ArUco marker on the active candidate, blanks the other candidates, captures USB cameras and optional network overview camera, decodes marker IDs from captured images, then writes:

  • projector_layout_check.json
  • layout_contact_usb_4.png
  • layout_contact_usb_5.png
  • optional layout_contact_network.png

Verified locally with:

.\build\Release\calibrator_cli.exe --verify-projector-layout 2,1 out\projector_layout_check_nocache 1 4,5 env:MAPPING_NETWORK_CAMERA_URL

Results:

  • Candidate A / CLI index 2 / DISPLAY3 lights the left projector.
  • Candidate B / CLI index 1 / DISPLAY2 lights the right projector.
  • USB camera contact sheets clearly show the active projector and the opposite side dark.
  • Initial network contact sheet reused a stale image; NetworkCamera was updated to append a cache-busting query parameter. Retest showed correct network overview images for both candidates.
  • ArUco retest wrote out\projector_layout_check_aruco2\projector_layout_check.json with "expectedMarkerDetected": true for both candidates:
    • marker 10 decoded from network and USB camera 5 for candidate A / CLI index 2;
    • marker 11 decoded from network and USB camera 4 for candidate B / CLI index 1.

Use this check after Windows reboot, cable changes, projector reconnects, or GPU driver changes before any calibration capture.

2026-05-25 - Step 06 GrayCode Capture From Verified Layout

Implemented GrayCode capture driven by the latest layout check report:

.\build\Release\calibrator_cli.exe --capture-graycode-sequence-from-layout <layout_json> <candidate:N|marker:N|display:N|left|right> <output_dir> [usb_csv] [network_url|env:VAR]

The command parses projector_layout_check.json, verifies the selected candidate has "expectedMarkerDetected": true, uses the current displayIndex from that report, blanks the other layout candidates, and writes a normal graycode_sequence_report.json with an additional layoutSource field.

Verified locally:

.\build\Release\calibrator_cli.exe --capture-graycode-sequence-from-layout out\projector_layout_check_aruco2\projector_layout_check.json left out\graycode_left_from_layout_smoke 4,5 env:MAPPING_NETWORK_CAMERA_URL
.\build\Release\calibrator_cli.exe --capture-graycode-sequence-from-layout out\projector_layout_check_aruco2\projector_layout_check.json right out\graycode_right_from_layout_smoke 4,5 env:MAPPING_NETWORK_CAMERA_URL

Results:

  • left selected current CLI display index 2 / DISPLAY3, blanked index 1, and captured 44/44 frames for network, usb_4, and usb_5.
  • right selected current CLI display index 1 / DISPLAY2, blanked index 2, and captured 44/44 frames for network, usb_4, and usb_5.
  • Contact sheets visually confirm the active side shows GrayCode while the opposite side is black.

Next step: decode GrayCode correspondences from the layout-selected captures, starting with left projector + USB camera 5.

2026-05-25 - Step 07 GrayCode Decode Diagnostics

Implemented first GrayCode correspondence decoder:

.\build\Release\calibrator_cli.exe --decode-graycode-sequence <sequence_dir> <camera_name> <output_dir> [sample_step] [white_threshold] [black_threshold] [modulation_threshold]

The command reads graycode_sequence_report.json, loads captured frame_000.png... images for the selected camera, configures OpenCV GrayCodePattern, decodes sampled camera pixels with getProjPixel, and writes:

  • decode_report.json
  • correspondences.csv
  • valid_mask.png
  • modulation.png
  • projector_x.png
  • projector_y.png

Initial decode without modulation filtering produced correct smooth projector X/Y gradients but also noisy false points outside the screen. Added a modulation threshold computed from max absolute difference across direct/inverted GrayCode frame pairs. Threshold 80 worked well on the current captures.

Verified locally:

.\build\Release\calibrator_cli.exe --decode-graycode-sequence out\graycode_left_from_layout_smoke usb_5 out\decode_left_usb5_t80 2 5 40 80
.\build\Release\calibrator_cli.exe --decode-graycode-sequence out\graycode_right_from_layout_smoke usb_4 out\decode_right_usb4_t80 2 5 40 80

Results:

  • Left + usb_5: 33,950 valid correspondences from 76,800 sampled pixels, valid ratio 0.442057, projector bounds (0,0)-(1919,1079).
  • Right + usb_4: 28,131 valid correspondences from 76,800 sampled pixels, valid ratio 0.366289, projector bounds (0,0)-(1899,1079).
  • Visual checks show valid masks concentrated on the projected screen and smooth projector_x/projector_y gradients.

Next step: add correspondence cleanup/ROI filtering and move toward a first calibration estimate.

2026-05-25 - Step 08 Correspondence Cleanup

Enhanced --decode-graycode-sequence so the decoder now keeps both raw and cleaned correspondence sets:

  • raw_correspondences.csv
  • cleaned_correspondences.csv
  • raw_valid_mask.png
  • cleaned valid_mask.png

Cleanup method:

  1. Decode raw sampled camera/projector correspondences.
  2. Build a sparse valid mask.
  3. Dilate the mask by the sampling stride so sparse points become connected regions.
  4. Run connected components.
  5. Keep the largest non-background component as the projected screen region.
  6. Write cleaned correspondences and cleaned projector X/Y visualizations.

Verified locally:

.\build\Release\calibrator_cli.exe --decode-graycode-sequence out\graycode_left_from_layout_smoke usb_5 out\decode_left_usb5_clean 2 5 40 80
.\build\Release\calibrator_cli.exe --decode-graycode-sequence out\graycode_right_from_layout_smoke usb_4 out\decode_right_usb4_clean 2 5 40 80

Results:

  • Left + usb_5: raw 33,950 -> cleaned 32,859 correspondences, 19 connected components before cleanup. Visual check removed side/bottom false groups and kept the main screen region.
  • Right + usb_4: raw 28,131 -> cleaned 28,129 correspondences, 2 connected components before cleanup. Visual check showed the original mask was already almost clean.

Next step: use cleaned_correspondences.csv for a first projector-camera calibration estimate.

2026-05-25 - Step 09 First Homography Estimate

Implemented first camera-to-projector homography diagnostic:

.\build\Release\calibrator_cli.exe --estimate-homography <decode_dir> <output_dir> [ransac_reproj_threshold]

The command reads cleaned_correspondences.csv, estimates camera image coordinates to projector pixel coordinates with OpenCV findHomography(..., RANSAC), and writes:

  • homography_report.json
  • homography_residuals.csv
  • homography_inliers.png
  • homography_residuals.png

Verified locally:

.\build\Release\calibrator_cli.exe --estimate-homography out\decode_left_usb5_clean out\homography_left_usb5 4
.\build\Release\calibrator_cli.exe --estimate-homography out\decode_right_usb4_clean out\homography_right_usb4 4

Results:

  • Left + usb_5: 32,859 correspondences, 19,224 inliers, inlier ratio 0.585045, mean inlier error 1.98597 projector pixels.
  • Right + usb_4: 28,129 correspondences, 4,720 inliers, inlier ratio 0.167798, mean inlier error 2.07464 projector pixels.

Interpretation:

  • The homography inliers themselves are precise, around 2 projector pixels mean error.
  • The low/global inlier ratio and residual heatmaps show systematic non-planar/curved-screen error, especially for the right projector.
  • This confirms the next model should be local grid/piecewise warp or depth-assisted geometry, not a single global homography.

2026-05-25 - Step 10 Local Warp Grid Diagnostics

Implemented local camera-space warp grid diagnostics:

.\build\Release\calibrator_cli.exe --build-local-warp-grid <decode_dir> <output_dir> [cell_size]

The command reads cleaned_correspondences.csv, bins correspondences into camera-space cells, computes average camera/projector coordinates per populated cell, and writes:

  • local_warp_grid_report.json
  • local_warp_grid.csv
  • grid_density.png
  • grid_vectors.png

Verified locally:

.\build\Release\calibrator_cli.exe --build-local-warp-grid out\decode_left_usb5_clean out\grid_left_usb5 24
.\build\Release\calibrator_cli.exe --build-local-warp-grid out\decode_right_usb4_clean out\grid_right_usb4 24

Results:

  • Left + usb_5: grid 23x17, 269/391 valid cells, valid cell ratio 0.68798, 32,859 correspondences.
  • Right + usb_4: grid 23x20, 226/460 valid cells, valid cell ratio 0.491304, 28,129 correspondences.

Interpretation:

  • Density images cover the projected screen regions well enough for a first local warp prototype.
  • Vector images change smoothly across both screens.
  • The right projector shows strong local direction changes, matching the poor global homography result and reinforcing that a piecewise/local warp model is needed.

Next step: generate a first projector-space warp mesh/PFM prototype from the local grid or add an interpolation layer from the cleaned correspondences.

2026-05-25 - Step 11 Projector Coverage Mask Diagnostics

Implemented projector-space coverage mask generation:

.\build\Release\calibrator_cli.exe --build-projector-coverage <decode_dir> <output_dir> [dilate_pixels] [close_pixels]

The command reads decode_report.json and cleaned_correspondences.csv, rasterizes decoded projector pixel coordinates into a sparse raw mask, optionally dilates/closes it, and writes:

  • projector_coverage_report.json
  • projector_coverage_raw.png
  • projector_coverage_alpha.png
  • projector_coverage_preview.png

Verified locally:

.\build\Release\calibrator_cli.exe --build-projector-coverage out\decode_left_usb5_clean out\coverage_left_usb5 3 9
.\build\Release\calibrator_cli.exe --build-projector-coverage out\decode_right_usb4_clean out\coverage_right_usb4 3 9

Results:

  • Left + usb_5: raw ratio 0.0158464, dilated/closed coverage ratio 0.956738, bounds (15,0)-(1919,1079).
  • Right + usb_4: raw ratio 0.0135648, dilated/closed coverage ratio 0.959511, bounds (0,0)-(1899,1079).

Interpretation:

  • The sparse raw projector samples are expected because the camera sampling step is 2 and the projector resolution is much larger.
  • Morphology fills most of the projector region, so this is useful as a diagnostic alpha/coverage mask.
  • It is not a final blend/overlap mask; object/shadow holes remain near the bottom and overlap must be derived from common camera/depth/screen geometry.

2026-05-25 - Step 12 Camera-Space Overlap Detection

Implemented overlap detection from two decode directories that use the same camera:

.\build\Release\calibrator_cli.exe --detect-overlap <left_decode_dir> <right_decode_dir> <output_dir> [dilate_pixels] [close_pixels]

The command reads both cleaned camera-space masks, computes their intersection, writes camera-space left/right/overlap masks and preview, then rasterizes overlap samples back into each projector's pixel space using the corresponding cleaned correspondences.

Before overlap, decoded the right projector from usb_5 so both sides used the same camera:

.\build\Release\calibrator_cli.exe --decode-graycode-sequence out\graycode_right_from_layout_smoke usb_5 out\decode_right_usb5_clean 2 5 40 80

Result: 10,639 cleaned correspondences, valid ratio 0.138529, projector bounds (0,0)-(675,1079).

Overlap verification:

.\build\Release\calibrator_cli.exe --detect-overlap out\decode_left_usb5_clean out\decode_right_usb5_clean out\overlap_usb5 3 9

Results:

  • Camera overlap pixels: 3,434.
  • Left overlap fraction: 0.104507.
  • Right overlap fraction: 0.322775.
  • Left projector overlap ratio after morphology: 0.116614.
  • Right projector overlap ratio after morphology: 0.118134.

Visual check:

  • camera_overlap_preview.png shows the overlap in the expected vertical seam region.
  • Projector overlap masks are binary diagnostics. Next step should generate left/right alpha falloff gradients inside these overlap masks.

2026-05-25 - Step 13 First Alpha Blend Masks

Implemented first projector-space alpha falloff masks:

.\build\Release\calibrator_cli.exe --generate-alpha-blend <overlap_dir> <output_dir> [gamma]

The command reads left_projector_overlap.png and right_projector_overlap.png, creates 8-bit left/right alpha masks, keeps full intensity outside overlap, applies a horizontal gamma falloff inside the overlap, and writes color previews plus alpha_blend_report.json.

Verified locally:

.\build\Release\calibrator_cli.exe --generate-alpha-blend out\overlap_usb5 out\alpha_usb5 1.0

Results:

  • Left alpha: 1920x1080, range 0-255, overlap bounds (1686,0)-(1919,1079), 241,811 overlap pixels.
  • Right alpha: 1920x1080, range 0-255, overlap bounds (0,0)-(233,1079), 244,962 overlap pixels.
  • left_alpha_preview.png fades at the left projector's right edge.
  • right_alpha_preview.png fades at the right projector's left edge.

This is a diagnostic linear/gamma blend only. Next work should refine the blend with projector coverage/geometry and eventually add black-level compensation.

2026-05-25 - Step 14 PFM Warp Prototype

Implemented the first diagnostic PFM warp-like exporter:

.\build\Release\calibrator_cli.exe --generate-pfm-warp-prototype <decode_dir> <output_dir> [dilate_pixels] [close_pixels]

The command reads decode_report.json and cleaned_correspondences.csv, splats projector pixels to normalized camera coordinates, fills holes inside the coverage mask with OpenCV inpainting, and writes:

  • warp_prototype.pfm
  • warp_preview.png
  • warp_u.png
  • warp_v.png
  • warp_valid_mask.png
  • pfm_warp_prototype_report.json

Verified locally:

.\build\Release\calibrator_cli.exe --generate-pfm-warp-prototype out\decode_left_usb5_clean out\pfm_left_usb5 3 9
.\build\Release\calibrator_cli.exe --generate-pfm-warp-prototype out\decode_right_usb4_clean out\pfm_right_usb4 3 9

Results:

  • Left: 1920x1080 PFM, 32,859 accepted samples, coverage ratio 0.956738, 1,983,892 valid pixels.
  • Right: 1920x1080 PFM, 28,129 accepted samples, coverage ratio 0.959511, 1,989,641 valid pixels.
  • PFM headers are PF, 1920 1080, -1.0; file size is 24,883,218 bytes for each output.
  • Float validation showed channel ranges inside expected bounds and valid in 0..1.
  • Preview images show smooth gradients across the projector coverage, with black holes matching known coverage/shadow holes.

This is not final nDisplay warp geometry. It is a projector-to-camera lookup scaffold; final warp needs Kinect/depth or a fitted screen model plus verified Unreal PFM convention.

2026-05-25 - Network Camera IP Updated

User changed the network overview camera IP.

Updated local ignored .env.local from the old IP to 192.168.1.40 without committing or logging credentials. Verified capture through the safe environment-variable path:

.\build\Release\calibrator_cli.exe --capture-network-camera env:MAPPING_NETWORK_CAMERA_URL out\network_camera_ip40_check\snapshot.png

Result: snapshot captured successfully at 1920x1080, mean 112.811, stddev 54.2927. The image shows the curved screen and projected calibration/checker content.

2026-05-25 - Step 15 Kinect v2 Probe

Implemented direct Kinect v2 probing through Microsoft Kinect SDK v2:

.\build\Release\calibrator_cli.exe --probe-kinect2 <output_dir>

CMake now auto-enables Kinect support on Windows when this SDK path exists:

C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409

The command saves:

  • color.png
  • depth_raw_16u.png
  • depth_preview.png
  • infrared_raw_16u.png
  • infrared_preview.png
  • kinect2_probe_report.json

Verified locally:

.\build\Release\calibrator_cli.exe --probe-kinect2 out\kinect_probe

Results:

  • sensorOpenHresult: 0x0.
  • availableInitial: false; availableAfterCapture: true; streamsCaptured: true.
  • Color frame: 1920x1080, mean 136.348, stddev 58.0319.
  • Depth frame: 512x424, reliable range 500-4500 mm, valid pixels 185,567, observed depth range 1022-4500 mm.
  • Infrared frame: 512x424, preview mean 26.4273, stddev 11.0233.

Visual checks show the curved screen in RGB, a usable depth heatmap, and an IR frame. Next step should convert Kinect depth pixels to camera-space 3D points and begin aligning Kinect geometry with GrayCode/projector correspondences.

2026-05-25 - Step 16 Kinect v2 Point Cloud Export

Implemented Kinect depth-to-point-cloud export:

.\build\Release\calibrator_cli.exe --export-kinect2-point-cloud <output_dir> [stride] [max_depth_mm]

The command captures Kinect depth and color, uses Microsoft Kinect SDK v2 ICoordinateMapper to convert depth pixels into Kinect camera-space XYZ coordinates in meters, maps RGB from the color frame when possible, and writes an ASCII PLY point cloud.

Verified locally:

.\build\Release\calibrator_cli.exe --export-kinect2-point-cloud out\kinect_point_cloud 1 4500

Results:

  • Depth input: 512x424, sampled 217,088 depth pixels with stride 1.
  • Point cloud: 185,431 points.
  • Colored points: 171,218.
  • Bounds in Kinect camera space: min (-3.22499, -2.55469, 0.631), max (2.38352, 2.28927, 4.475) meters.
  • PLY header declares element vertex 185431.
  • Visual point_cloud_front_preview.png shows the screen/scene from Kinect view.
  • Visual point_cloud_top_preview.png clearly shows the curved screen arc.

Next step should segment the actual screen surface from this raw scene point cloud before fitting a screen model or aligning it with GrayCode/projector correspondences.

2026-05-25 - Step 17 Kinect Screen Segmentation

Implemented first bounds-based screen segmentation:

.\build\Release\calibrator_cli.exe --segment-kinect-screen <point_cloud_dir> <output_dir> [min_x max_x min_y max_y min_z max_z]

The command reads kinect_point_cloud.ply, filters Kinect camera-space points by adjustable meter bounds, writes screen_points.ply, and creates screen_front_preview.png, screen_top_preview.png, and screen_segment_report.json.

Initial broad bounds kept too much floor/background. Tuned defaults to:

x=-2.25..2.15
y=-0.55..0.25
z=1.25..3.45

Verified locally:

.\build\Release\calibrator_cli.exe --segment-kinect-screen out\kinect_point_cloud out\kinect_screen_segment

Results:

  • Source point cloud: 185,431 points.
  • Screen segment: 40,169 points.
  • Kept ratio: 0.216625.
  • Segment bounds: min (-2.24926, -0.549997, 2.665), max (1.93202, 0.246633, 3.449) meters.
  • screen_top_preview.png shows a clean curved screen arc with most floor/stand/background clutter removed.

Next step should fit a curved surface/cylinder model to screen_points.ply and reject residual outliers.

2026-05-25 - Step 18 Kinect RGB As Additional Camera

Implemented Kinect v2 RGB as an additional calibration camera source named kinect_color.

New command:

.\build\Release\calibrator_cli.exe --capture-kinect2-color <output_png>

Capture commands that normally take USB camera CSV can now include +kinect, for example:

.\build\Release\calibrator_cli.exe --verify-projector-layout 2,1 out\layout 2 4,5,+kinect
.\build\Release\calibrator_cli.exe --capture-graycode-sequence-from-layout out\projector_layout_check_kinect_color_flip2\projector_layout_check.json left out\graycode_left_kinect_color_smoke2 +kinect

Important implementation detail:

  • Kinect SDK color frames appeared mirrored for calibration-camera use.
  • kinect_color capture outputs are flipped horizontally before saving so ArUco/GrayCode camera geometry is usable.
  • Raw SDK color frames used internally for Kinect depth/color mapping remain unflipped.

Verification:

  • --capture-kinect2-color out\kinect_color_check\color.png: captured 1920x1080, mean 138.472, stddev 58.2602.
  • --probe-hardware out\hardware_probe_kinect_color 5: wrote kinectColor JSON section and kinect_color.png, 1920x1080, mean 142.226, stddev 58.4572.
  • --project-and-capture 0 checker out\project_capture_primary_kinect_color 1 4,5,+kinect: captured usb_4, usb_5, and kinect_color.
  • Initial layout verification before flipping Kinect RGB showed visible but mirrored text/marker; after flipping, Kinect RGB decoded marker 10 for left/display 2 and marker 11 for right/display 1.
  • GrayCode Kinect RGB left-projector capture produced 44/44 frames after increasing first-frame Kinect warmup.
  • Decode command:
.\build\Release\calibrator_cli.exe --decode-graycode-sequence out\graycode_left_kinect_color_smoke2 kinect_color out\decode_left_kinect_color_smoke2 4 5 40 80

Result: 21,396 cleaned correspondences from 129,600 sampled pixels, valid ratio 0.165093, projector bounds (0,0)-(1919,1079), smooth projector X/Y diagnostics.

Next step should use Kinect SDK color/depth mapping to project decoded kinect_color pixels into Kinect camera-space 3D points, creating projector-pixel to 3D screen correspondences.

2026-05-25 - Step 19 Network Camera Default Pipeline

Implemented default network camera participation across calibration capture stages.

Behavior:

  • If no explicit network URL argument is passed, the CLI tries MAPPING_NETWORK_CAMERA_URL from the process environment.
  • If the environment variable is not loaded, the CLI falls back to local ignored .env.local.
  • The URL/credentials are used only for capture and are not written into reports.
  • Passing none as the optional network camera argument disables network capture for that run.

Applies to:

  • --probe-hardware
  • --verify-projector-layout
  • --project-and-capture
  • --project-and-capture-isolated
  • --capture-graycode-sequence-isolated
  • --capture-graycode-sequence-from-layout

Verification:

.\build\Release\calibrator_cli.exe --verify-projector-layout 2,1 out\projector_layout_check_network_default 2 4,5,+kinect

Result: without explicitly passing the URL, the command loaded the network camera from .env.local. Contact sheets included kinect_color, network, usb_4, and usb_5. Network decoded marker 10 for left/display 2 and marker 11 for right/display 1.

GrayCode verification:

.\build\Release\calibrator_cli.exe --capture-graycode-sequence-from-layout out\projector_layout_check_network_default\projector_layout_check.json left out\graycode_left_network_default_smoke +kinect

Result: network captured 44/44 frames; kinect_color captured 44/44 frames.

Network decode:

.\build\Release\calibrator_cli.exe --decode-graycode-sequence out\graycode_left_network_default_smoke network out\decode_left_network_default_smoke 4 5 40 80

Result: 23,259 cleaned correspondences from 129,600 sampled pixels, valid ratio 0.179468, projector bounds (12,0)-(1919,1079), smooth projector X diagnostics.

2026-05-25 - Step 20 Kinect RGB Decode To 3D Bridge

Implemented the first hybrid 2D/3D calibration bridge.

New command:

.\build\Release\calibrator_cli.exe --map-kinect-color-decode-to-3d <decode_dir> <output_dir> [search_radius_px] [max_depth_mm]

What it does:

  • Reads cleaned_correspondences.csv from a kinect_color GrayCode decode.
  • Captures fresh Kinect v2 depth and color frames.
  • Uses Kinect SDK ICoordinateMapper to map depth pixels to camera-space XYZ and raw SDK color pixels.
  • Converts saved kinect_color decode coordinates back to SDK color coordinates because calibration captures are horizontally de-mirrored.
  • Writes projector-pixel to Kinect camera-space 3D samples.

Verification command:

.\build\Release\calibrator_cli.exe --map-kinect-color-decode-to-3d out\decode_left_kinect_color_smoke2 out\projector_3d_left_kinect 4 4500

Result:

  • Input correspondences: 21,396.
  • Matched correspondences: 18,706.
  • Match ratio: 0.874276.
  • Mean search distance: 0.036274 px.
  • Bounds in Kinect camera space: (0.0954764, -1.16996, 2.674) to (1.96908, 0.173243, 3.54) meters.

Outputs:

  • out\projector_3d_left_kinect\projector_3d_correspondences.csv
  • out\projector_3d_left_kinect\projector_3d_points.ply
  • out\projector_3d_left_kinect\projector_3d_top_preview.png
  • out\projector_3d_left_kinect\projector_3d_front_preview.png
  • out\projector_3d_left_kinect\projector_3d_color_preview.png
  • out\projector_3d_left_kinect\depth_preview.png
  • out\projector_3d_left_kinect\projector_3d_report.json

Visual check:

  • Top preview shows a curved screen arc from the matched projector/depth samples.
  • Front preview shows dense projector-covered samples.
  • Extra/right-edge/background samples remain, so the next step should filter matched 3D points against the segmented screen surface and fit a smooth surface model before generating final warp geometry.

2026-05-25 - Full Calibration Session With Kinect/Network

Captured a fresh full calibration session:

out\full_calibration_20260525_0335

Layout:

  • DISPLAY3, CLI display index 2, marker 10: left projector.
  • DISPLAY2, CLI display index 1, marker 11: right projector.
  • Layout verification included usb_4, usb_5, network, and kinect_color.
  • Kinect RGB and network decoded both projector markers; USB 5 decoded the left marker, USB 4 decoded the right marker.

GrayCode capture:

  • Left projector: 44/44 frames for usb_4, usb_5, network, kinect_color.
  • Right projector: 44/44 frames for usb_4, usb_5, network, kinect_color.

Decode summary:

  • Left usb_5: 32,835/76,800, valid ratio 0.427539.
  • Right usb_4: 28,014/76,800, valid ratio 0.364766.
  • Left kinect_color: 18,987/129,600, valid ratio 0.146505.
  • Right kinect_color: 17,946/129,600, valid ratio 0.138472.
  • Left network: 23,226/129,600, valid ratio 0.179213.
  • Right network: 13,435/129,600, valid ratio 0.103665.
  • Left usb_4: 17,562/76,800, valid ratio 0.228672.
  • Right usb_5: 9,964/76,800, valid ratio 0.12974.

Derived diagnostics:

  • Left homography from usb_5: 19,474/32,835 inliers, ratio 0.593087, mean inlier error 1.83881.
  • Right homography from usb_4: 4,456/28,014 inliers, ratio 0.159063, mean inlier error 1.97667.
  • USB 5 overlap pair: 3,572 camera overlap pixels; projector overlap ratios 0.115963 left and 0.117539 right.
  • Alpha blend masks generated from USB 5 overlap.
  • PFM prototypes generated: left coverage 0.955885, right coverage 0.957506.
  • Fresh Kinect point cloud: 184,736 points, 170,757 colored.
  • Fresh screen segment: 40,216 points, kept ratio 0.217694.

Kinect 3D bridge:

  • Left projector: 16,624/18,987 Kinect decode samples mapped to depth/3D, ratio 0.875546.
  • Right projector: 17,946/17,946 samples mapped to depth/3D, ratio 1.0.

2026-05-25 - Step 21 Filter Projector 3D Samples By Screen Segment

Implemented:

.\build\Release\calibrator_cli.exe --filter-projector-3d-by-screen-segment <projector_3d_dir> <screen_segment_dir> <output_dir> [max_distance_m]

The command:

  • Reads projector_3d_correspondences.csv.
  • Reads screen_points.ply.
  • Builds a voxel nearest-neighbor lookup over the screen segment.
  • Keeps projector 3D samples within the configured distance from the segmented screen surface.
  • Writes filtered CSV, PLY, top/front previews, and JSON report.

Verification with 0.08 m threshold:

.\build\Release\calibrator_cli.exe --filter-projector-3d-by-screen-segment out\full_calibration_20260525_0335\projector_3d_left_kinect out\full_calibration_20260525_0335\kinect_screen_segment out\full_calibration_20260525_0335\filtered_projector_3d_left_kinect 0.08
.\build\Release\calibrator_cli.exe --filter-projector-3d-by-screen-segment out\full_calibration_20260525_0335\projector_3d_right_kinect out\full_calibration_20260525_0335\kinect_screen_segment out\full_calibration_20260525_0335\filtered_projector_3d_right_kinect 0.08

Results:

  • Left: kept 9,999/16,624, keep ratio 0.60148, mean nearest distance 0.00908242 m.
  • Right: kept 10,995/17,946, keep ratio 0.612671, mean nearest distance 0.00787641 m.

Visual check:

  • Top previews show clean left/right arcs of the curved screen after background/lower outlier removal.
  • This is now ready for the first smooth surface fitting pass.

2026-05-25 - Step 22 Fit Screen Surface

Implemented first smooth screen surface fitting:

.\build\Release\calibrator_cli.exe --fit-screen-surface <left_filtered_3d_dir> <right_filtered_3d_dir> <screen_segment_dir> <output_dir> [grid_x] [grid_y]

Current model:

  • vertical_cylindrical_arc_xz
  • circle fit in Kinect camera-space X/Z
  • active vertical range from filtered left/right projector samples
  • robust second fit pass after excluding points farther than 0.12 m from the first arc

Verification command:

.\build\Release\calibrator_cli.exe --fit-screen-surface out\full_calibration_20260525_0335\filtered_projector_3d_left_kinect out\full_calibration_20260525_0335\filtered_projector_3d_right_kinect out\full_calibration_20260525_0335\kinect_screen_segment out\full_calibration_20260525_0335\screen_surface_fit 128 40

Result:

  • Inputs: left 9,999, right 10,995, screen segment 40,216, total 61,210.
  • Robust fit inliers: 61,171.
  • Circle center X/Z: (0.011876, 0.416237).
  • Radius: 2.95867 m.
  • Mesh: 128 x 40, 5,120 vertices, 9,906 faces.
  • RMS residuals:
    • left projector samples: 0.0286836 m
    • right projector samples: 0.0303674 m
    • screen segment: 0.0362382 m
    • all samples: 0.0341005 m

Outputs:

  • out\full_calibration_20260525_0335\screen_surface_fit\screen_surface_mesh.ply
  • out\full_calibration_20260525_0335\screen_surface_fit\screen_surface_top_preview.png
  • out\full_calibration_20260525_0335\screen_surface_fit\screen_surface_front_preview.png
  • out\full_calibration_20260525_0335\screen_surface_fit\surface_fit_samples.csv
  • out\full_calibration_20260525_0335\screen_surface_fit\screen_surface_report.json

Next step:

  • Use the surface mesh/model plus filtered projector samples to generate a real surface-based projector warp geometry instead of the current diagnostic 2D lookup PFM.

2026-05-25 - Step 23 Surface Warp Mesh

Implemented the first surface-based projector warp mesh diagnostic:

.\build\Release\calibrator_cli.exe --build-surface-warp-mesh <filtered_projector_3d_dir> <surface_fit_dir> <output_dir> [grid_x] [grid_y] [max_projector_distance_px]

What it does:

  • Reads filtered_projector_3d_correspondences.csv.
  • Reads the fitted cylindrical surface from screen_surface_report.json.
  • Builds a regular grid in observed projector pixel space.
  • Interpolates 3D samples using nearest projector-space neighbors.
  • Projects each vertex back onto the fitted screen surface for stable Z.
  • Writes a PLY mesh with 3D XYZ plus projector UV/pixel attributes.

Verification:

.\build\Release\calibrator_cli.exe --build-surface-warp-mesh out\full_calibration_20260525_0335\filtered_projector_3d_left_kinect out\full_calibration_20260525_0335\screen_surface_fit out\full_calibration_20260525_0335\surface_warp_left_kinect 96 54 180
.\build\Release\calibrator_cli.exe --build-surface-warp-mesh out\full_calibration_20260525_0335\filtered_projector_3d_right_kinect out\full_calibration_20260525_0335\screen_surface_fit out\full_calibration_20260525_0335\surface_warp_right_kinect 96 54 180

Results:

  • Left: 9,999 input samples, 96 x 54 grid, 5,184/5,184 valid vertices, mean nearest projector distance 5.22542 px, max 49.4364 px.
  • Right: 10,995 input samples, 96 x 54 grid, 5,184/5,184 valid vertices, mean nearest projector distance 7.42829 px, max 110.136 px.

Outputs:

  • surface_warp_mesh.ply
  • surface_warp_vertices.csv
  • surface_warp_projector_preview.png
  • surface_warp_top_preview.png
  • surface_warp_front_preview.png
  • surface_warp_mesh_report.json

Important limitation:

  • The current meshes cover observed Kinect-filtered projector regions only:
    • left observed projector bounds: x=223..1919, y=0..698
    • right observed projector bounds: x=2..1895, y=0..709
  • Before final nDisplay export, decide whether to extrapolate to full 1920x1080 or keep observed active region and rely on masks.

2026-05-25 - Step 24 Hybrid Surface Warp Export

Implemented the chosen hybrid policy:

  • full-frame 1920x1080 PFM container
  • observed-region surface geometry only
  • alpha mask opens only the observed valid region
  • outside observed region PFM is zero and alpha is zero
  • beta/black-level mask is present as an all-zero placeholder

Command:

.\build\Release\calibrator_cli.exe --export-hybrid-surface-warp <surface_warp_mesh_dir> <output_dir> [projector_width] [projector_height]

Verification:

.\build\Release\calibrator_cli.exe --export-hybrid-surface-warp out\full_calibration_20260525_0335\surface_warp_left_kinect out\full_calibration_20260525_0335\hybrid_surface_warp_left 1920 1080
.\build\Release\calibrator_cli.exe --export-hybrid-surface-warp out\full_calibration_20260525_0335\surface_warp_right_kinect out\full_calibration_20260525_0335\hybrid_surface_warp_right 1920 1080

Results:

  • Left: observed bounds (223,0)-(1919,698), active pixels 1,186,203, active ratio 0.57205.
  • Right: observed bounds (2,0)-(1895,709), active pixels 1,344,740, active ratio 0.648505.
  • Alpha masks have exactly the active pixel counts above.
  • Beta masks are all zero.
  • Preview images show smooth XYZ fields only in observed region; outside is black.

Outputs per projector:

  • surface_warp_full_frame_xyz.pfm
  • surface_warp_alpha_mask.png
  • surface_warp_beta_mask.png
  • surface_warp_full_frame_preview.png
  • hybrid_surface_warp_report.json

Important:

  • Current PFM channels are metric Kinect camera-space x_m,y_m,z_m.
  • Exact Unreal nDisplay PFM semantics still need verification; add a converter/export mode if Unreal expects normalized UV-like warp data or a different coordinate basis.

2026-05-25 - Surface Check Review And Smooth Warp Mesh

User visually checked projected patterns and reported:

  • raw table had no actual warp/blend;
  • hybrid image covered only part of the screen;
  • projected lines were visibly wavy.

Findings:

  • Partial coverage is expected with the chosen hybrid policy because alpha is zero outside observed region.
  • Wavy lines are not acceptable. The first surface warp mesh used nearest-neighbor/IDW interpolation from noisy Kinect/decode samples, which can create local waves.
  • The surface check image also originally used raw X as the horizontal coordinate; it now uses cylindrical arc angle when the fitted circle is available.

Implemented fix:

  • --build-surface-warp-mesh now fits a degree-3 polynomial model from projector coordinates to cylindrical surface coordinates:
    • projector x/y -> screen arc angle theta
    • projector x/y -> screen height Y
    • then converts theta/Y back to smooth cylindrical X/Y/Z
  • Nearest sample distance is still used for validity/diagnostics.

Verification outputs:

.\build\Release\calibrator_cli.exe --build-surface-warp-mesh out\full_calibration_20260525_0335\filtered_projector_3d_left_kinect out\full_calibration_20260525_0335\screen_surface_fit out\full_calibration_20260525_0335\surface_warp_left_smooth 96 54 180
.\build\Release\calibrator_cli.exe --build-surface-warp-mesh out\full_calibration_20260525_0335\filtered_projector_3d_right_kinect out\full_calibration_20260525_0335\screen_surface_fit out\full_calibration_20260525_0335\surface_warp_right_smooth 96 54 180

Results:

  • Left smooth model: theta RMS 0.000894156, max 0.00424912; Y RMS 0.00267861 m, max 0.0173959 m.
  • Right smooth model: theta RMS 0.000923297, max 0.00566621; Y RMS 0.00285035 m, max 0.0208334 m.

Smoothed hybrid exports:

.\build\Release\calibrator_cli.exe --export-hybrid-surface-warp out\full_calibration_20260525_0335\surface_warp_left_smooth out\full_calibration_20260525_0335\hybrid_surface_warp_left_smooth 1920 1080
.\build\Release\calibrator_cli.exe --export-hybrid-surface-warp out\full_calibration_20260525_0335\surface_warp_right_smooth out\full_calibration_20260525_0335\hybrid_surface_warp_right_smooth 1920 1080

Geometry-only visual command used:

.\build\Release\calibrator_cli.exe --project-hybrid-surface-check 2 1 out\full_calibration_20260525_0335\hybrid_surface_warp_left_smooth out\full_calibration_20260525_0335\hybrid_surface_warp_right_smooth 120

If the smoothed projection still looks wavy, the next fix is not blend/masks; it is a better projector calibration model using projector pose/intrinsics and joint optimization across USB cameras + Kinect depth rather than relying mainly on Kinect RGB projector-to-3D samples.

2026-05-25 - Surface Alpha Blend Live Check

Implemented:

  • Added --generate-surface-alpha-blend <left_hybrid_dir> <right_hybrid_dir> <output_dir> [gamma].
  • It reads full-frame hybrid XYZ PFM files and observed-region alpha masks, computes left/right coverage in fitted cylindrical surface theta, finds the shared theta overlap, and writes left/right alpha masks plus previews/report.
  • --project-hybrid-surface-check already accepts the generated alpha directory as its optional final argument.

Verification:

.\build\Release\calibrator_cli.exe --generate-surface-alpha-blend out\full_calibration_20260525_0335\hybrid_surface_warp_left_smooth out\full_calibration_20260525_0335\hybrid_surface_warp_right_smooth out\full_calibration_20260525_0335\surface_alpha_smooth 1.0
.\build\Release\calibrator_cli.exe --project-hybrid-surface-check 2 1 out\full_calibration_20260525_0335\hybrid_surface_warp_left_smooth out\full_calibration_20260525_0335\hybrid_surface_warp_right_smooth 120 out\full_calibration_20260525_0335\surface_alpha_smooth
.\build\Release\calibrator_cli.exe --probe-hardware out\surface_alpha_smooth_probe 8

Results:

  • Surface overlap theta: 1.45166..1.54312.
  • Left is lower-theta projector; alpha fades down across the overlap.
  • Right alpha fades up across the same surface overlap.
  • Probe images:
    • out\surface_alpha_smooth_probe\network_camera.png
    • out\surface_alpha_smooth_probe\camera4.png
    • out\surface_alpha_smooth_probe\camera5.png
  • Live camera review: smoothed warp removed most line waviness and alpha direction is correct, but the overlap still has visible seam misregistration near the center. Next work should refine local geometry/registration in the overlap, likely using shared 2D lookup correspondences plus surface coordinates, then regenerate masks.

2026-05-25 - Full-Frame Surface Diagnostic

User pointed out that the projected check image did not reach the left side and bottom of the screen. This was correct: the previous hybrid export used a full-frame container, but surface_warp_alpha_mask.png was zero outside the observed region. The left projector observed region started at about x=223, and both projectors only had observed data down to about y=700, so the diagnostic intentionally blacked those zones.

Implemented:

  • --build-surface-warp-mesh accepts optional [projector_width projector_height].
  • When those are passed, the smooth projector-to-cylindrical-surface polynomial is evaluated across the full projector frame, while nearest-sample validity still marks trusted/observed vertices.
  • --export-hybrid-surface-warp accepts optional [observed|full].
  • In full mode, surface_warp_alpha_mask.png is active for the full projector frame and surface_warp_observed_alpha_mask.png separately records the trusted observed region.

Verification:

.\build\Release\calibrator_cli.exe --build-surface-warp-mesh out\full_calibration_20260525_0335\filtered_projector_3d_left_kinect out\full_calibration_20260525_0335\screen_surface_fit out\full_calibration_20260525_0335\surface_warp_left_full_smooth 128 72 180 1920 1080
.\build\Release\calibrator_cli.exe --build-surface-warp-mesh out\full_calibration_20260525_0335\filtered_projector_3d_right_kinect out\full_calibration_20260525_0335\screen_surface_fit out\full_calibration_20260525_0335\surface_warp_right_full_smooth 128 72 180 1920 1080
.\build\Release\calibrator_cli.exe --export-hybrid-surface-warp out\full_calibration_20260525_0335\surface_warp_left_full_smooth out\full_calibration_20260525_0335\hybrid_surface_warp_left_full_smooth 1920 1080 full
.\build\Release\calibrator_cli.exe --export-hybrid-surface-warp out\full_calibration_20260525_0335\surface_warp_right_full_smooth out\full_calibration_20260525_0335\hybrid_surface_warp_right_full_smooth 1920 1080 full
.\build\Release\calibrator_cli.exe --generate-surface-alpha-blend out\full_calibration_20260525_0335\hybrid_surface_warp_left_full_smooth out\full_calibration_20260525_0335\hybrid_surface_warp_right_full_smooth out\full_calibration_20260525_0335\surface_alpha_full_smooth 1.0
.\build\Release\calibrator_cli.exe --project-hybrid-surface-check 2 1 out\full_calibration_20260525_0335\hybrid_surface_warp_left_full_smooth out\full_calibration_20260525_0335\hybrid_surface_warp_right_full_smooth 120 out\full_calibration_20260525_0335\surface_alpha_full_smooth
.\build\Release\calibrator_cli.exe --probe-hardware out\surface_full_smooth_probe 8

Results:

  • Left full mesh trusted vertices: 7007/9216.
  • Right full mesh trusted vertices: 7082/9216.
  • Full exports active pixels: 2073600/2073600 for both projectors.
  • Observed/trusted pixels: left 1568597, right 1585189.
  • Live probe images show the check image reaches the left edge and bottom. The remaining visible problem is seam/local registration quality, not coverage.

2026-05-25 - Oriented Cylinder Warp Correction

User correctly identified the first remaining problem as warp curvature, not blend or coverage: horizontal check lines were not parallel to the physical bend/edge of the curved screen.

Root cause:

  • The previous screen model was vertical_cylindrical_arc_xz.
  • That assumed the cylinder axis was exactly Kinect camera Y.
  • The live screen is tilted relative to Kinect, so constant Kinect Y is not the same thing as a physical horizontal line on the screen.

Implemented:

  • Added screen-local oriented cylinder support.
  • --fit-screen-surface now estimates a PCA screen frame and writes screenFrame:
    • origin
    • axis
    • radialU
    • radialV
  • --build-surface-warp-mesh now uses surface theta plus screen-axis coordinate for the polynomial model when a screenFrame is present.
  • Surface check rendering now uses screen-axis coordinate for vertical pattern placement, instead of raw Kinect Y.

Verification:

.\build\Release\calibrator_cli.exe --fit-screen-surface out\full_calibration_20260525_0335\filtered_projector_3d_left_kinect out\full_calibration_20260525_0335\filtered_projector_3d_right_kinect out\full_calibration_20260525_0335\kinect_screen_segment out\full_calibration_20260525_0335\screen_surface_fit_oriented 128 40
.\build\Release\calibrator_cli.exe --build-surface-warp-mesh out\full_calibration_20260525_0335\filtered_projector_3d_left_kinect out\full_calibration_20260525_0335\screen_surface_fit_oriented out\full_calibration_20260525_0335\surface_warp_left_oriented_full_smooth 128 72 180 1920 1080
.\build\Release\calibrator_cli.exe --build-surface-warp-mesh out\full_calibration_20260525_0335\filtered_projector_3d_right_kinect out\full_calibration_20260525_0335\screen_surface_fit_oriented out\full_calibration_20260525_0335\surface_warp_right_oriented_full_smooth 128 72 180 1920 1080
.\build\Release\calibrator_cli.exe --export-hybrid-surface-warp out\full_calibration_20260525_0335\surface_warp_left_oriented_full_smooth out\full_calibration_20260525_0335\hybrid_surface_warp_left_oriented_full_smooth 1920 1080 full
.\build\Release\calibrator_cli.exe --export-hybrid-surface-warp out\full_calibration_20260525_0335\surface_warp_right_oriented_full_smooth out\full_calibration_20260525_0335\hybrid_surface_warp_right_oriented_full_smooth 1920 1080 full
.\build\Release\calibrator_cli.exe --generate-surface-alpha-blend out\full_calibration_20260525_0335\hybrid_surface_warp_left_oriented_full_smooth out\full_calibration_20260525_0335\hybrid_surface_warp_right_oriented_full_smooth out\full_calibration_20260525_0335\surface_alpha_oriented_full_smooth 1.0
.\build\Release\calibrator_cli.exe --project-hybrid-surface-check 2 1 out\full_calibration_20260525_0335\hybrid_surface_warp_left_oriented_full_smooth out\full_calibration_20260525_0335\hybrid_surface_warp_right_oriented_full_smooth 120 out\full_calibration_20260525_0335\surface_alpha_oriented_full_smooth
.\build\Release\calibrator_cli.exe --probe-hardware out\surface_oriented_full_probe 8

Results:

  • Oriented screen axis: [-0.0214249, 0.962567, -0.270194].
  • This confirms the Kinect-Y assumption was materially wrong.
  • Camera review shows improved screen-local curvature of horizontal grid lines, but local warp/seam errors remain.
  • Next work should optimize geometry using camera-observed line/feature alignment against the screen model before spending more time on blend masks.

2026-05-25 - Rejected Boundary Linear Warp Experiment

User pointed out that the right-side vertical grid lines were still not parallel to the physical right screen edge.

Experiment tried:

  • Added a temporary boundary-normalized surface coordinate model:
    • left/right theta boundaries as linear functions of screen-axis coordinate;
    • top/bottom axis boundaries as linear functions of theta;
    • projector mapping fitted against normalized boundary coordinates.
  • Generated and projected:
    • out\full_calibration_20260525_0335\screen_surface_fit_boundary
    • out\full_calibration_20260525_0335\surface_warp_left_boundary_full_smooth
    • out\full_calibration_20260525_0335\surface_warp_right_boundary_full_smooth
    • out\full_calibration_20260525_0335\hybrid_surface_warp_left_boundary_full_smooth
    • out\full_calibration_20260525_0335\hybrid_surface_warp_right_boundary_full_smooth
    • out\full_calibration_20260525_0335\surface_alpha_boundary_full_smooth
    • probe images in out\surface_boundary_full_probe.

Result:

  • The experiment failed visibly. The network camera image showed a large wrong lower duplicate/warped region and unusable edge behavior.
  • The temporary code was reverted and not committed.
  • Do not reintroduce a simple linear boundary-normalized model as-is.

Conclusion:

  • The right-edge vertical-line error is real, but it should be fixed by local projector-to-camera/surface optimization, not by a simple global boundary normalization.
  • Next preferred direction: measure projected grid/check features in the cameras, compare observed positions against expected screen-local coordinates, and fit a local correction field over projector pixels or surface coordinates.

2026-05-25 - Dense Marker Grid For Camera-Observed Warp

User proposed replacing the visual checker with a dense computer-vision marker table, similar in density to a labelled color grid, with unique content for every projector/display. This is the right direction for the next warp correction step because readable marker ids provide both identity and observed screen coverage.

Implemented:

  • --generate-marker-grid <display_index> <output_dir> [columns] [rows]
  • --project-marker-grid <display_index> [seconds] [columns] [rows]
  • --detect-marker-grid <image_path> <output_dir>
  • Pattern uses OpenCV ArUco DICT_5X5_1000.
  • Default tested density: 20x11 = 220 markers per display.
  • Current id blocks:
    • left projector / display 2: marker ids 440..659
    • right projector / display 1: marker ids 220..439
  • marker_grid_manifest.csv maps marker id to display index, device name, row/col, projector cell bounds, expected center, and label.

Important implementation note:

  • Decorative text labels on top of the markers reduced detection reliability. They were removed from the projected image; labels remain in the CSV manifest.

Verification:

.\build\Release\calibrator_cli.exe --generate-marker-grid 2 out\marker_grid_left 20 11
.\build\Release\calibrator_cli.exe --detect-marker-grid out\marker_grid_left\marker_grid.png out\marker_grid_left_detect_self
.\build\Release\calibrator_cli.exe --generate-marker-grid 1 out\marker_grid_right 20 11
.\build\Release\calibrator_cli.exe --detect-marker-grid out\marker_grid_right\marker_grid.png out\marker_grid_right_detect_self

Results:

  • Offline generated PNG self-detection: 220/220 markers for both left and right tables.

Live left-projector check:

.\build\Release\calibrator_cli.exe --project-marker-grid 2 120 20 11
.\build\Release\calibrator_cli.exe --probe-hardware out\marker_grid_left_live_probe 8
.\build\Release\calibrator_cli.exe --detect-marker-grid out\marker_grid_left_live_probe\network_camera.png out\marker_grid_left_live_probe\network_detect
.\build\Release\calibrator_cli.exe --detect-marker-grid out\marker_grid_left_live_probe\camera4.png out\marker_grid_left_live_probe\camera4_detect
.\build\Release\calibrator_cli.exe --detect-marker-grid out\marker_grid_left_live_probe\camera5.png out\marker_grid_left_live_probe\camera5_detect

Live detection counts:

  • Network camera: 73 markers.
  • USB camera4: 61 markers.
  • USB camera5: 178 markers.

Next:

  • Build a marker-grid analysis step that joins detected_markers.csv with marker_grid_manifest.csv.
  • Use readable marker ids to estimate projector visible region and screen boundaries.
  • Use marker center errors to fit a local projector correction field before further blend work.

2026-05-25 - Dense Marker Grid Parameters

User asked to make the markers slightly smaller and remove spacing between them so screen boundaries can be estimated more accurately, noting that more USB cameras or a high-resolution photo can be used later if recognition becomes difficult.

Implemented:

  • --generate-marker-grid and --project-marker-grid now accept optional [marker_scale] [white_margin_scale].
  • Defaults changed to smaller markers: marker scale 0.54, white margin scale 0.06.
  • Generated cells already have no gaps; marker bounding boxes are now also written to the manifest:
    • marker_x0
    • marker_y0
    • marker_x1
    • marker_y1

Dense test:

.\build\Release\calibrator_cli.exe --generate-marker-grid 2 out\marker_grid_left_dense 24 13 0.50 0.04
.\build\Release\calibrator_cli.exe --detect-marker-grid out\marker_grid_left_dense\marker_grid.png out\marker_grid_left_dense_detect_self
.\build\Release\calibrator_cli.exe --generate-marker-grid 1 out\marker_grid_right_dense 24 13 0.50 0.04
.\build\Release\calibrator_cli.exe --detect-marker-grid out\marker_grid_right_dense\marker_grid.png out\marker_grid_right_dense_detect_self

Offline result:

  • Dense left PNG: 312/312 markers detected.
  • Dense right PNG: 312/312 markers detected.

Live left-projector dense test:

.\build\Release\calibrator_cli.exe --project-marker-grid 2 120 24 13 0.50 0.04
.\build\Release\calibrator_cli.exe --probe-hardware out\marker_grid_left_dense_live_probe 8

Detection result on current cameras:

  • Network camera: 5 markers.
  • USB camera4: 13 markers.
  • USB camera5: 32 markers.

Conclusion:

  • 24x13 / 0.50 / 0.04 is too dense for current live camera geometry/resolution.
  • Keep 20x11 as reliable live default for current cameras.
  • Dense mode is useful for tomorrow's additional USB cameras or high-resolution photo import.

2026-05-25 - Monochrome Marker Grid

User suggested removing the color background and placing markers closer together to improve calibration precision.

Implemented:

  • Marker-grid background is now monochrome white by default.
  • Color background remains available with final argument color.
  • New command form:
.\build\Release\calibrator_cli.exe --generate-marker-grid <display_index> <output_dir> [columns] [rows] [marker_scale] [white_margin_scale] [mono|color]
.\build\Release\calibrator_cli.exe --project-marker-grid <display_index> [seconds] [columns] [rows] [marker_scale] [white_margin_scale] [mono|color]

Important:

  • Do not remove the white ArUco quiet zone entirely. Markers can be close in a white field, but black marker bodies should not touch each other directly or detection quality can collapse.

Tested mono dense pattern:

.\build\Release\calibrator_cli.exe --generate-marker-grid 2 out\marker_grid_left_mono_dense 24 13 0.72 0.03 mono
.\build\Release\calibrator_cli.exe --generate-marker-grid 1 out\marker_grid_right_mono_dense 24 13 0.72 0.03 mono

Offline result:

  • Left mono dense PNG: 312/312.
  • Right mono dense PNG: 312/312.

Live left-projector result:

.\build\Release\calibrator_cli.exe --project-marker-grid 2 120 24 13 0.72 0.03 mono
.\build\Release\calibrator_cli.exe --probe-hardware out\marker_grid_left_mono_dense_live_probe 8

Detection counts:

  • Network camera: 180.
  • USB camera4: 91.
  • USB camera5: 249.

Comparison:

  • Previous color dense live result was only network 5, camera4 13, camera5 32.
  • Monochrome dense is therefore the recommended dense boundary/correction pattern.

Note:

  • The live preview still showed an older color pattern on the other projector. For final marker-grid capture, blank the inactive projector or add a synchronized dual-projector marker-grid command so both projectors show unique id ranges simultaneously.

2026-05-25 - OAK-D PoE And Added USB Cameras

User added two more USB cameras and an OAK-D PoE camera, then provided OAK-D IP 192.168.1.100.

Implemented and documented:

  • Added tools/oakd_poe_probe.py as a repeatable Python DepthAI diagnostic tool.
  • Added docs/step_32_oakd_poe_probe.md.
  • Updated AGENTS.md and README.md with the OAK-D probe commands.
  • Updated the marker-grid implementation so marker scale 1.0 fills the tile while preserving the requested ArUco quiet zone inside the tile. This supports the user's no-gap marker-grid boundary workflow.

Verification:

Test-NetConnection 192.168.1.100 -Port 11490
py -c "import depthai as dai; print(dai.__version__)"
py tools\oakd_poe_probe.py --ip 192.168.1.100 --output out\oakd_poe_probe --skip-depth --reconnect-delay 4
py tools\oakd_poe_probe.py --ip 192.168.1.100 --output out\oakd_poe_probe_depth --only-depth --skip-eeprom --reconnect-delay 4
.\build\Release\calibrator_cli.exe --probe-hardware out\hardware_probe_after_oakd 12
.\build\Release\calibrator_cli.exe --generate-marker-grid 2 out\marker_grid_left_mono_tight_verify 24 13 1.0 0.04 mono
.\build\Release\calibrator_cli.exe --detect-marker-grid out\marker_grid_left_mono_tight_verify\marker_grid.png out\marker_grid_left_mono_tight_verify_detect

Results:

  • OAK-D PoE reachable on 192.168.1.100:11490.
  • Python depthai version 3.6.1.
  • Device: OAK-D-POE, mxid/device id 184430102127401300.
  • Cameras: CAM_A IMX378 color 4056x3040, CAM_B OV9282 1280x800, CAM_C OV9282 1280x800.
  • EEPROM calibration was saved to out\oakd_poe_probe\oakd_calibration_eeprom.json.
  • RGB/mono frames were saved in out\oakd_poe_probe.
  • Depth was saved in a separate stable pass at out\oakd_poe_probe_depth; valid depth pixels 33,078, min 940 mm, max 12,973 mm, mean 3004.42 mm.
  • Current OAK-D images show the room/desk rather than the curved screen. OAK-D must be physically aimed at the screen before it can help mapping calibration.
  • --probe-hardware now sees 10 OpenCV camera indices. Useful screen cameras are 4, 5, 6, and 7; 8 and 9 look like duplicate virtual/test streams.
  • Kinect color and network camera still capture successfully during hardware probe.
  • Tight marker-grid offline verification detected 312/312 markers.

Important nuance:

  • Running RGB/mono and stereo depth in the same DepthAI process caused the PoE device/runtime to crash once. The stable workflow is to split RGB/mono and depth into separate commands, as documented in Step 32.

2026-05-25 - OAK-D PoE Recalibration Research

User clarified that the OAK-D PoE should be calibrated before use, and asked to find how Luxonis expects it to be done.

Findings:

  • The current OAK-D EEPROM report says boardName=DM2088, boardRev=R0M0E0, productName=OAK-D PoE AF.
  • In luxonis/depthai-boards, batch/oak_d_poe.json maps DM2088 OAK-D PoE AF variants to board_config_file: OAK-D-POE.json.
  • boards/OAK-D-POE.json defines:
    • CAM_A: color
    • CAM_B: left mono
    • CAM_C: right mono
    • stereo pair: CAM_B / CAM_C
    • nominal baseline left-to-right: 7.5 cm
  • depthai-core contains DynamicCalibration examples, but the first recommended project workflow is manual ChArUco calibration because it is more controlled and easier to validate before flashing.

Repository update:

  • Added docs/step_33_oakd_poe_recalibration.md.
  • Linked it from README.md.

Operational rule:

  • Backup EEPROM before recalibration.
  • Use a flat ChArUco board with known square/marker dimensions.
  • Use board config OAK-D-POE.
  • Validate reprojection/depth quality before flashing a new calibration.

2026-05-25 - OAK-D PoE Monitor ChArUco Capture

Ran OAK-D PoE recalibration capture using the primary BenQ GL2580 monitor as a fullscreen ChArUco target.

Implementation/support work:

  • Added --generate-display-charuco and --project-display-charuco to calibrator_cli.
  • Generated a screen-physical-size-aware 13x7 ChArUco board for the BenQ GL2580 active area 543.74 x 302.61 mm, with 40 mm squares and 30 mm markers.
  • Luxonis calibrate.py was taken from luxonis/depthai develop branch into C:\git\depthai_calibration_work.
  • A local venv was created with depthai==2.32.0.0 for compatibility with the old script API.
  • Local-only patches were needed for OpenCV 4.13 compatibility and to prevent automatic EEPROM flashing.

Capture:

  • Working output: C:\git\mappping\out\oakd_recalibration_20260525_205548.
  • Dataset contains 8 images each for rgb, left, and right.
  • One attempted pose failed first because RGB saw too few markers, then was successfully recaptured.

Processing result:

  • RGB reprojection: 2.628012632378635 px.
  • Left mono reprojection: 0.21674459114221134 px.
  • Right mono reprojection: 0.19678258017494626 px.
  • Left/right stereo epipolar: 0.11357288807630539 px.
  • Right/RGB epipolar: 0.25790154933929443 px.
  • Summary written to out\oakd_recalibration_20260525_205548\calibration_summary.json.
  • Full result config written to out\oakd_recalibration_20260525_205548\calibration_result_config.json.

Conclusion:

  • The stereo mono calibration is good enough as a depth candidate.
  • RGB reprojection is higher; before flashing or using RGB-aligned depth heavily, prefer a second capture pass with more pose diversity, sharper RGB focus, and the board filling the RGB frame more consistently.

2026-05-25 - OAK-D Manual Preview Capture Tool

The Luxonis manual UI became unreliable for the monitor target workflow:

  • s did not consistently finish capture.
  • The default polygon/count flow behaved strangely after about six captures.
  • Some failed captures produced partial datasets where only one or two camera images were written.
  • RGB preview was initially cropped when using ColorCamera.video.

Added project-local helper tools:

  • tools/show_image_borderless.py: borderless full-screen-sized ChArUco display on the primary monitor without forcing TopMost, so VS Code can be brought above it when needed.
  • tools/show_image_fullscreen.py and tools/show_image_window.py: helper display modes used while debugging.
  • tools/oakd_charuco_manual_capture.py: live RGB/left/right preview, manual Space capture of full triplets, f force save, s finish.
  • tools/oakd_charuco_triplet_capture.py: non-GUI timed triplet capture experiment.

Important implementation decision:

  • Use OAK-D RGB isp output with THE_12_MP and setIspScale(1, 3), not video, because video cropped the IMX378 4:3 sensor and made RGB preview appear incorrectly zoomed.

Best current manual capture:

  • Output: out\oakd_manual_preview_20260525_223541.
  • Captures: 7 complete RGB/left/right triplets.
  • RGB reprojection: 0.35417608689285046 px.
  • Left reprojection: 0.40673566976918113 px.
  • Right reprojection: 0.5296403259647054 px.
  • Left/right epipolar: 0.38702332973480225 px.
  • Right/RGB epipolar: 0.9392728209495544 px.

Conclusion:

  • Manual full-FOV RGB capture solves the high RGB reprojection problem seen in the Luxonis UI run.
  • Stereo is acceptable but worse than the first monitor-based Luxonis result; before EEPROM flashing, run another manual pass with 8-12 varied poses and strong marker counts in the mono cameras.

2026-05-25 - OAK-D 16-Pose Manual Auto-Exposure Candidate

Ran another OAK-D PoE manual ChArUco pass after stabilizing the borderless target and manual preview workflow.

Capture:

  • Output: out\oakd_manual_preview_20260525_230655.
  • Dataset contains 16 complete triplets for rgb, left, and right.
  • All saved poses passed the 8 marker minimum on all cameras.
  • Marker coverage was mostly high; RGB dropped to 19-20 markers on two more oblique poses, but remained above threshold.

Processing result:

  • RGB reprojection: 0.5598922482994096 px.
  • Left mono reprojection: 0.5680762517534417 px.
  • Right mono reprojection: 0.4712016925154703 px.
  • Left/right epipolar: 0.19170166552066803 px.
  • Right/RGB epipolar: 1.2531731128692627 px.

Implementation note:

  • Updated OAK-D manual and timed triplet capture tools so RGB and mono exposure are auto by default.
  • Manual exposure now activates only when --rgb-exposure-us or --mono-exposure-us is explicitly greater than zero.

Conclusion:

  • This is the best balanced OAK-D calibration candidate so far: better stereo epipolar than the seven-pose manual run and far better RGB reprojection than the first Luxonis UI run.
  • Do not flash EEPROM automatically. Validate the candidate with depth/RGB checks before writing it to the device.

2026-05-25 - OAK-D EEPROM Flash

The user approved writing the OAK-D PoE calibration to EEPROM.

Actions:

  • Saved a fresh pre-flash backup to out\oakd_poe_before_eeprom_flash_20260525_230655\oakd_calibration_eeprom.json.
  • Built a depthai.CalibrationHandler from out\oakd_manual_preview_20260525_230655\calibration_result_config.json.
  • Saved the exact EEPROM candidate JSON to out\oakd_manual_preview_20260525_230655\oakd_eeprom_candidate_flashed.json.
  • Flashed user calibration with device.flashCalibration2(calibration_handler) using depthai==2.32.0.0.
  • Read EEPROM back to out\oakd_manual_preview_20260525_230655\oakd_eeprom_after_flash.json.

Verification:

  • Device reopened successfully after flash.
  • MXID: 184430102127401300.
  • EEPROM version after flash: 7.
  • Readback intrinsics/distortion for RGB/left/right match the 16-pose candidate.
  • Post-flash RGB/mono probe output: out\oakd_poe_after_eeprom_flash_20260525_230655.
  • Post-flash depth probe output: out\oakd_poe_after_eeprom_flash_depth_20260525_230655.

Nuance:

  • Depth pipeline started, but immediate depth valid pixels were low (1471). Re-aim and recheck the OAK-D against the curved projection screen before relying on OAK-D depth for mapping.

2026-05-25 - One-Second GrayCode Fast Capture

Added a fast GrayCode capture mode for projector calibration.

Implementation:

  • --capture-graycode-sequence-isolated and --capture-graycode-sequence-from-layout now accept optional frame_hold_ms.
  • When frame_hold_ms > 0, USB cameras are opened once before the GrayCode sequence and kept open until the sequence finishes.
  • During the displayed hold interval, the CLI continuously drains USB camera buffers and saves the freshest frame before switching to the next GrayCode pattern.

Why this matters:

  • The first naive 1-second attempt saved stale USB frames from internal camera buffers, producing poor decode results even though every camera wrote 44/44 images.
  • Draining the USB buffers during the hold fixed the issue.

Verification:

  • Current layout at this point: left projector CLI 1 / DISPLAY2, right projector CLI 2 / DISPLAY3.
  • Left fast test: out\fast_graycode_1s_test_left_freshusb, all 44/44 frames for usb_4, usb_5, usb_6, usb_7, network, and kinect_color.
  • Right fast test: out\fast_graycode_1s_test_right_freshusb, all 44/44 frames for the same sources.
  • Decode sample step 4, thresholds 5/40/80:
    • Left: best USB is usb_6 with 13,263/19,200 valid samples, then usb_5 with 8,147/19,200; Kinect color 18,937/129,600; network 13,066/129,600.
    • Right: best USB is usb_7 with 10,186/19,200, then usb_4 with 6,295/19,200; Kinect color 18,821/129,600; network 10,996/129,600.

Conclusion:

  • One-second GrayCode frames are viable if fast USB capture mode is used.
  • For the current camera positions, prefer usb_6 and usb_5 for the left projector, and usb_7 and usb_4 for the right projector. Kinect color remains useful for full-frame coverage; network remains useful for overview/global QA.

2026-05-26 - Full Fast Calibration Pass Plus OAK-D Pass

Ran a fresh calibration pass from layout verification through surface warp preview.

Layout:

  • Current display order: primary CLI 0 / DISPLAY1, left projector CLI 1 / DISPLAY2, right projector CLI 2 / DISPLAY3.
  • Layout output: out\calibration_20260526_0000\projector_layout.
  • Marker 10 identified the left projector, marker 11 identified the right projector.

Main GrayCode capture:

  • Left: out\calibration_20260526_0000\graycode_left.
  • Right: out\calibration_20260526_0000\graycode_right.
  • Both used one-second fast mode with usb_4,usb_5,usb_6,usb_7,+kinect plus network camera.
  • All sources captured 44/44 frames for both projectors.

Main decode:

  • Left best USB: usb_6 with 13,230/19,200 valid samples; usb_5 also strong with 8,117/19,200.
  • Right best USB: usb_7 with 8,501/19,200; usb_4 also useful with 6,297/19,200.
  • Kinect color decode stayed stable: left 18,803/129,600, right 18,681/129,600.
  • Network decode stayed useful for overview: left 10,058/129,600, right 11,059/129,600.

OAK-D separate GrayCode capture:

  • Left: out\calibration_20260526_0000\graycode_left_oakd.
  • Right: out\calibration_20260526_0000\graycode_right_oakd.
  • oakd_rgb, oakd_left, and oakd_right captured 44/44 frames for both projectors.
  • OAK-D decode:
    • Left: oakd_rgb 13,981/85,852, oakd_left 7,002/64,000, oakd_right 7,328/64,000.
    • Right: oakd_rgb 23,817/85,852, oakd_left 9,176/64,000, oakd_right 9,111/64,000.

Screen surface and warp:

  • Kinect point cloud: 189,477 points, 174,926 colored.
  • Screen segment: 41,449 points.
  • Kinect color decode to 3D: left matched 18,337/18,803 (97.5%), right matched 18,681/18,681 (100%).
  • Filtered projector 3D samples: left 11,470, right 11,356.
  • Oriented cylindrical surface fit: radius 2.95242 m, all RMS residual 0.0545963 m.
  • Full-frame hybrid warp exports:
    • out\calibration_20260526_0000\hybrid_surface_warp_left_full
    • out\calibration_20260526_0000\hybrid_surface_warp_right_full
  • Surface alpha: out\calibration_20260526_0000\surface_alpha_full, overlap theta 1.52383..1.62326.

Visual probe:

  • Projected check command used --project-hybrid-surface-check 1 2 ... surface_alpha_full.
  • Captures are in out\calibration_20260526_0000\surface_check_probe.
  • Combined camera contact sheet: out\calibration_20260526_0000\surface_check_probe\surface_check_contact.png.

Conclusion:

  • The fast capture pipeline works and OAK-D can be captured/decode-tested separately.
  • Current full-frame surface warp covers the screen and produces a usable check image, but local geometry/seam alignment is still not final. The next improvement should be camera-observed local warp correction using dense marker grids or feature alignment on top of the Kinect surface model.

2026-05-26 - Camera-Observed Boundary Correction Test

The user pointed out that both vertical and horizontal test lines were not parallel to the real screen borders. Because Kinect cannot be physically leveled or repositioned without the table occluding the screen, started a software correction path.

Inputs:

  • Marker grids generated for current projector displays:
    • Left CLI 1 / DISPLAY2: out\calibration_20260526_0000\marker_grid_left, ids 312..623.
    • Right CLI 2 / DISPLAY3: out\calibration_20260526_0000\marker_grid_right, ids 624..935.
  • Both grids were projected simultaneously and captured in out\calibration_20260526_0000\marker_grid_probe.
  • Marker detection counts:
    • network: 480
    • Kinect color: 495
    • USB4: 274
    • USB5: 228
    • USB6: 292
    • USB7: 311

Implementation:

  • Added helper scripts:
    • tools/show_two_images_borderless.py to project arbitrary left/right PNGs on both projectors.
    • tools/generate_camera_observed_check.py to build a camera-observed check pattern.
  • The correction uses detected marker centers to estimate a camera-space visible screen quad, creates an ideal grid in that camera view, then uses GrayCode correspondences to resample that desired camera-space pattern back into each projector.
  • The first sparse scatter version was too holey; switched to dense interpolation from projector pixels to camera pixels using scipy.interpolate.griddata.

Outputs:

  • Sparse attempt: out\calibration_20260526_0000\camera_observed_correction_probe\camera_observed_contact.png.
  • Dense network-camera correction:
    • Generated projector images: out\calibration_20260526_0000\camera_observed_correction_network_dense.
    • Captured result: out\calibration_20260526_0000\camera_observed_correction_dense_probe.
    • Contact sheet: out\calibration_20260526_0000\camera_observed_correction_dense_probe\camera_observed_dense_contact.png.

Conclusion:

  • The dense camera-observed correction substantially improves line alignment in the network-camera view and confirms that the issue is coordinate-frame/local-warp related, not projector output failure.
  • It is currently optimized to the network camera only, so side USB views still show local seam/geometry mismatch. The next production step should combine multiple cameras into one correction field rather than trusting only the overview camera.

2026-05-26 - 4s Unified USB/OAK-D GrayCode And USB Correction Test

The user requested a slower pass with 4 seconds per GrayCode pattern, no fixed exposure changes, and OAK-D participating as a webcam in the main pass instead of doing a separate second pass.

Implementation:

  • Added tools/capture_graycode_with_oakd.py.
  • The tool projects GrayCode and captures USB cameras plus OAK-D streams in one pass:
    • usb_4, usb_5, usb_6, usb_7
    • oakd_rgb, oakd_left, oakd_right
  • It can also attempt network capture, but the first left run had network 0/44; network was not used for this correction path.

4s unified captures:

  • Left: out\calibration_20260526_4s_oak_unified\graycode_left.
    • USB and OAK-D streams captured 44/44.
    • Network failed in this Python pass (0/44), while C++ network capture remains known-good.
  • Right: out\calibration_20260526_4s_oak_unified\graycode_right.
    • USB and OAK-D streams captured 44/44.

Decode results:

  • Left:
    • usb_6: 11,987/19,200
    • usb_5: 7,991/19,200
    • oakd_rgb: 3,926/85,852
    • oakd_left: 6,998/64,000
    • oakd_right: 7,343/64,000
  • Right:
    • usb_7: 10,763/19,200
    • usb_4: 6,258/19,200
    • oakd_rgb: 8,342/85,852
    • oakd_left: 9,152/64,000
    • oakd_right: 9,100/64,000

Correction test:

  • Updated tools/generate_camera_observed_check.py to allow separate left/right detected marker CSVs.
  • Generated correction using the best current USB cameras:
    • left side from marker_detect_camera6 + decode_left_usb_6
    • right side from marker_detect_camera7 + decode_right_usb_7
  • Output: out\calibration_20260526_4s_oak_unified\camera_observed_correction_usb6_usb7.
  • Captured result: out\calibration_20260526_4s_oak_unified\camera_observed_usb6_usb7_probe\camera_observed_usb6_usb7_contact.png.

OAK-D boundary check:

  • Captured marker grid with OAK-D in out\calibration_20260526_4s_oak_unified\oakd_marker_grid_probe.
  • Marker detection found 0 markers in oakd_rgb, oakd_left, and oakd_right.
  • OAK-D can currently participate in GrayCode/decode diagnostics, but should not yet drive boundary/local correction until marker-grid visibility is fixed.

Conclusion:

  • Slower 4s capture does not automatically remove all waviness. It improves/stabilizes some sources, but the correction quality is now dominated by how the local correction field is fit and regularized.
  • The latest USB6/USB7 correction is better than network-only and less holey/wavy, but still not a final multi-camera warp.
  • Next step should regularize the correction field and optionally create a larger/brighter OAK-D-readable marker grid before using OAK-D for boundary correction.

2026-05-26 - Regularized Multi-Camera Correction Attempt

The user correctly pointed out that the previous calibration was bad: projector overlap did not stitch and the projected grid had obvious waviness. This was confirmed in the captured camera sheets.

Implementation:

  • Added tools/generate_regularized_multicamera_check.py.
  • The tool fuses multiple camera GrayCode correspondences into one projector correction field.
  • It supports a shared --reference-detected-csv marker grid so USB cameras can be mapped into the same overview UV frame instead of each camera using its own local hull.
  • The final version uses a low-wave model:
    • affine baseline projector-to-screen UV fit;
    • residual polynomial correction;
    • baseline residual outlier rejection;
    • Huber-like residual weighting;
    • maximum UV correction clamp during image generation.

Tests:

  • First cubic reference-UV output:
    • out\calibration_20260526_4s_oak_unified\regularized_multicamera_reference_uv
    • captured in regularized_multicamera_reference_uv_probe.
    • Result was bad: strong waves and no acceptable seam.
  • Low-wave output:
    • out\calibration_20260526_4s_oak_unified\regularized_multicamera_low_wave
    • captured contact sheet: out\calibration_20260526_4s_oak_unified\regularized_multicamera_low_wave_probe\regularized_multicamera_low_wave_contact.png
    • left inliers 10017/15310, fit RMS 0.0396 UV;
    • right inliers 6886/12918, fit RMS 0.0234 UV.
  • Ultra-smooth output:
    • out\calibration_20260526_4s_oak_unified\regularized_multicamera_ultra_smooth
    • captured contact sheet: out\calibration_20260526_4s_oak_unified\regularized_multicamera_ultra_smooth_probe\regularized_multicamera_ultra_smooth_contact.png
    • left inliers 7859/15310, fit RMS 0.0372 UV;
    • right inliers 5288/12918, fit RMS 0.0231 UV.

Conclusion:

  • The low-wave regularizer prevents local bad samples from creating large S-shaped waves, but it does not yet make the calibration correct.
  • The current data still contains a deeper coordinate-frame problem: GrayCode camera correspondences, marker-grid UV, and projector overlap are not yet constrained by a single physical screen/surface model.
  • Do not treat these images as final warp/blend. They are diagnostic outputs showing that the correction field can be made smooth, while the shared 2D/3D screen model still needs to be fixed.
  • Next production step: build a shared marker-ID/surface solve where readable marker IDs define one screen coordinate system, Kinect/OAK/USB observations attach to that same system, and the overlap seam is explicitly constrained between projectors.

2026-05-26 - Marker-ID Polynomial UV And Marker-Sampled Projector Fit

Follow-up to the failed regularized multi-camera correction.

Implementation:

  • Extended tools/generate_regularized_multicamera_check.py.
  • Added --camera-uv-model poly.
    • Instead of mapping a USB camera to the reference camera with one homography, the tool now fits a polynomial camera-pixel to reference-UV model from all shared marker ids.
    • This reduces the "curved screen through a flat quad" error.
  • Added --sample-mode markers.
    • The tool samples projector coordinates at detected marker centers by nearest GrayCode correspondence.
    • This makes the fit marker-id/screen driven instead of dense-noisy-GrayCode driven.

Runs:

  • Polynomial camera UV with dense GrayCode samples:
    • out\calibration_20260526_4s_oak_unified\regularized_multicamera_marker_poly
    • captured: out\calibration_20260526_4s_oak_unified\regularized_multicamera_marker_poly_probe\regularized_multicamera_marker_poly_contact.png
    • marker UV RMS by source was about 0.014 to 0.018 UV.
    • GrayCode inlier fit RMS improved to about 0.0158 UV left and 0.0099 UV right.
  • Polynomial camera UV with marker-sampled projector points:
    • out\calibration_20260526_4s_oak_unified\regularized_multicamera_marker_sampled
    • captured: out\calibration_20260526_4s_oak_unified\regularized_multicamera_marker_sampled_probe\regularized_multicamera_marker_sampled_contact.png
    • left used 444 marker samples, right used 455 marker samples.

Conclusion:

  • The polynomial marker-id UV model is numerically healthier than the homography-only approach.
  • The marker-sampled projector fit is more physically meaningful, but the visual result is still not an acceptable calibration.
  • This confirms that the next solve must use a shared 3D/surface coordinate constraint, not just 2D reference-camera UV. The reference camera is useful for observation/QA, but the curved screen coordinate system must come from the Kinect/OAK/depth-backed surface model and the projector overlap seam must be constrained explicitly.

2026-05-26 - OAK-D RGB 4K Calibration Camera Mode

The user decided to use OAK-D PoE through the DepthAI API as a high-resolution RGB calibration camera, not as a Windows webcam, and to remove OAK 1080/mono streams from the main calibration path.

Implementation:

  • Updated tools/oakd_graycode_capture.py.
    • OAK stream list is now only oakd_rgb_4k.
    • RGB uses THE_4_K, 3840x2160, default 5 fps, CAM_A, BGR, autofocus continuous.
    • Mono streams oakd_left and oakd_right are no longer created.
  • Updated tools/capture_graycode_with_oakd.py.
    • Unified USB/network/OAK capture now imports the same OAK 4K RGB pipeline.
    • Report includes monoStreamsEnabled=false.
  • Updated tools/oakd_live_preview.py.
    • Preview now shows only oakd_rgb_4k.

Verification:

  • Python syntax check passed for all three tools.
  • Live one-frame DepthAI probe against 192.168.1.100 succeeded and wrote:
    • out\oakd_rgb_4k_probe\oakd_rgb_4k_isp.png
    • frame shape: (2160, 3840, 3).
  • The first test using the video output produced a valid 4K frame but logged a DepthAI crash dump at shutdown. The implementation was switched to color.isp, which also produced 3840x2160 and avoided the crash message in the second test.

Notes:

  • OAK-D was initially busy because old oakd_live_preview.py processes were still running. Stop old preview windows before starting a new OAK capture.
  • The dark screen 4K frame had a green cast. Recheck exposure/white balance with projected marker/grid content before relying on marker detection. Add explicit AWB/exposure controls if marker detection remains weak.

2026-05-26 - OAK Temporarily Excluded From Active Calibration

The user decided to exclude OAK from the active workflow for now.

Implementation:

  • Stopped running OAK preview/capture processes.
  • Updated tools/capture_graycode_with_oakd.py so OAK is disabled by default.
  • Added explicit --enable-oakd flag for future use.
  • Moved DepthAI import in tools/oakd_graycode_capture.py behind OAK-specific code so the unified USB/network capture path does not touch DepthAI unless OAK is explicitly enabled.

Current active calibration sources:

  • USB cameras usb_4, usb_5, usb_6, usb_7.
  • Network camera if MAPPING_NETWORK_CAMERA_URL is available.
  • Kinect color/depth through the C++ CLI where needed.

OAK status:

  • Keep OAK out of marker-grid, GrayCode, layout verification, and correction generation until explicitly re-enabled.
  • The OAK 4K RGB code remains available behind --enable-oakd, but should not be used in the next calibration pass.

2026-05-26 - USB Camera Resolution Fix

During the step-by-step recalibration, the user noticed that USB cameras were capturing at 640x480 even though the BRIO cameras should support 1920x1080 and C270 cameras should support 1280x720.

Cause:

  • mapping::camera::UsbCamera opened DirectShow cameras without setting CAP_PROP_FRAME_WIDTH, CAP_PROP_FRAME_HEIGHT, FPS, or MJPG.
  • DirectShow therefore selected each camera's default mode, usually 640x480.

Verification before code change:

  • Manual Python DirectShow probe showed:
    • camera4: accepts 1920x1080 MJPG.
    • camera5: accepts 1920x1080 MJPG.
    • camera6: does not accept requested 1920x1080 as 16:9, but accepts 1280x720 MJPG.
    • camera7: does not accept requested 1920x1080 as 16:9, but accepts 1280x720 MJPG.

Implementation:

  • Updated libs/camera/src/UsbCamera.cpp.
  • On open/enumerate, try preferred MJPG modes in order:
    1. 1920x1080 @ 30
    2. 1280x720 @ 30
    3. 640x480 @ 30
  • Accept a mode only when the captured frame dimensions match the requested dimensions.

Verification after code change:

  • Rebuilt Release successfully.
  • Hardware probe output:
    • out\step_calibration_20260526\step02a_usb_resolution_probe
    • Contact sheet: out\step_calibration_20260526\step02a_usb_resolution_probe\usb_resolution_contact.png
  • Confirmed:
    • camera4: 1920x1080
    • camera5: 1920x1080
    • camera6: 1280x720
    • camera7: 1280x720
    • network and Kinect remain 1920x1080.

Important:

  • The left GrayCode capture from step 2 was recorded before this fix and should be treated as obsolete. Redo left GrayCode capture before decoding or continuing to right-projector capture.

2026-05-26 - USB Quad Preview Shortcut

The user requested a desktop shortcut to view the four active USB cameras for physical camera framing.

Implementation:

  • Added tools/usb_quad_preview.py.
    • Opens USB cameras 4,5,6,7.
    • Requests MJPG preferred modes in the same order as the C++ capture path.
    • Shows one 2x2 OpenCV preview window with actual resolution labels.
    • Close with q or Esc.
  • Added tools/run_usb_quad_preview.ps1.
  • Created desktop shortcut:
    • C:\Users\post\Desktop\USB Cameras Preview.lnk.

Verification:

  • py -m py_compile tools\usb_quad_preview.py passed.
  • A short launch test started the preview process successfully, then it was stopped so the cameras would not remain busy.

Follow-up:

  • User reported the preview appeared cropped.
  • Updated tools/usb_quad_preview.py to letterbox each camera frame into its tile, preserving full frame and aspect ratio.
  • Updated tools/run_usb_quad_preview.ps1 to use 600x338 tiles so the 2x2 preview fits more comfortably on the primary monitor.

2026-05-26 - USB Resolution Probe For System-Level Checks

The user asked to make cameras visible at full resolution in the system, not only inside one calibration command.

Important Windows note:

  • UVC/DirectShow camera resolution is normally selected by each application when opening the camera.
  • There is no reliable global Windows setting that forces every application to use 1080p/720p for these cameras.
  • Therefore the practical fix is to make every mapping tool request the correct mode and provide a repeatable probe to verify what DirectShow returns.

Implementation:

  • Updated tools/capture_graycode_with_oakd.py USB path to request the same preferred MJPG modes as the C++ UsbCamera class.
  • Added tools/usb_resolution_probe.py.
    • Probes USB cameras through DirectShow.
    • Requests 1920x1080, 1280x720, then 640x480.
    • Marks a mode accepted only if the actual captured frame matches the requested dimensions.

Verification:

  • py tools\usb_resolution_probe.py --cameras 4,5,6,7 --output out\usb_resolution_probe_system_check
  • Confirmed accepted mapping:
    • camera4: 1920x1080 via 1080p_mjpg
    • camera5: 1920x1080 via 1080p_mjpg
    • camera6: 1280x720 via 720p_mjpg
    • camera7: 1280x720 via 720p_mjpg

2026-05-26 - Step Calibration High-Res GrayCode Decode

After fixing USB camera resolution, the old left GrayCode sequence was treated as obsolete and both projector sequences were captured/decoded again in high resolution.

Current step-by-step calibration root:

  • out\step_calibration_20260526

High-res captures:

  • Left projector: out\step_calibration_20260526\step02_graycode_left_highres
  • Right projector: out\step_calibration_20260526\step03_graycode_right_highres

Decode command settings:

  • sample_step=4
  • white_threshold=5
  • black_threshold=40
  • modulation_threshold=80

Decode outputs and coverage:

  • Left:
    • step04_decode_left_usb_5: 27321/129600, ratio 0.2108, camera 1920x1080, projector bounds (5,0)-(1919,1079).
    • step04_decode_left_usb_6: 7857/57600, ratio 0.1364, camera 1280x720, projector bounds (0,0)-(1919,1079).
    • step04_decode_left_kinect_color: 18934/129600, ratio 0.1461, camera 1920x1080, projector bounds (0,0)-(1919,1079).
    • step04_decode_left_network: 24342/129600, ratio 0.1878, camera 1920x1080, projector bounds (64,0)-(1919,1079).
  • Right:
    • step04_decode_right_usb_4: 31635/129600, ratio 0.2441, camera 1920x1080, projector bounds (0,0)-(1910,1079).
    • step04_decode_right_usb_7: 29894/57600, ratio 0.5190, camera 1280x720, projector bounds (1,0)-(1893,1079).
    • step04_decode_right_kinect_color: 18890/129600, ratio 0.1458, camera 1920x1080, projector bounds (0,0)-(1908,1079).
    • step04_decode_right_network: 21859/129600, ratio 0.1687, camera 1920x1080, projector bounds (0,0)-(1919,1079).

Visual summary:

  • out\step_calibration_20260526\step04_decode_summary_contact.png

Current interpretation:

  • Best left projector sources: usb_5, network, kinect_color, with usb_6 useful for wide/overlap context but lower coverage.
  • Best right projector sources: usb_4 and usb_7; usb_7 has the strongest ratio because it sees the right projector area well at 1280x720.
  • Kinect decodes are valuable even with lower ratio because they bridge to Kinect depth/surface.

2026-05-26 - Denser High-Res Decode Candidate

The user requested a denser decode with:

  • sample_step=2
  • white_threshold=5
  • black_threshold=30
  • modulation_threshold=70

No new capture was made; this was a re-decode of the existing high-res left/right GrayCode sequences.

Outputs:

  • Summary image: out\step_calibration_20260526\step04b_decode_s2_m70_summary_contact.png

Coverage compared with the previous sample_step=4, black=40, modulation=80 decode:

  • Left:
    • usb_5: 27321 -> 109549, 4.01x, ratio 0.2113.
    • usb_6: 7857 -> 34053, 4.33x, ratio 0.1478.
    • kinect_color: 18934 -> 76136, 4.02x, ratio 0.1469.
    • network: 24342 -> 97979, 4.03x, ratio 0.1890.
  • Right:
    • usb_4: 31635 -> 127108, 4.02x, ratio 0.2452.
    • usb_7: 29894 -> 120275, 4.02x, ratio 0.5220.
    • kinect_color: 18890 -> 75685, 4.01x, ratio 0.1460.
    • network: 21859 -> 83842, 3.84x, ratio 0.1617.

Current interpretation:

  • This denser decode is a strong candidate for the next pipeline step because valid pixel count increased about 4x while valid ratios stayed stable.
  • Before using it for final geometry, visually inspect projector_x/projector_y outputs for local decode noise; the summary did not show an obvious catastrophic failure.

2026-05-26 - Locked USB Controls, Reference Frames, Kinect/Network Retest

The user requested fixed USB exposure/gain/white-balance, black/white reference frames at the start of capture, and asked whether the same can be done for Kinect while also testing the network camera.

Implemented in mapping:

  • libs\camera\src\UsbCamera.cpp now reads MAPPING_USB_CAMERA_PRESET and applies per-camera DirectShow/OpenCV controls after opening:
    • autoExposure=false
    • fixed exposure
    • fixed gain
    • autoWhiteBalance=false
    • fixed whiteBalance
  • tools\calibrate_usb_camera_controls.py was added to sweep USB exposure values while projecting black/gray/white fields and write usb_camera_preset.json.
  • apps\calibrator_cli\src\main.cpp now captures reference_black and reference_white frames before GrayCode frames for all active sources: USB, network, and Kinect color.

Important Kinect finding:

  • Microsoft Kinect v2 SDK exposes IColorCameraSettings for the color camera, but only read-only values such as ExposureTime, Gain, and Gamma on frames. The current SDK path does not expose a supported manual set/disable-auto control equivalent to UVC CAP_PROP_AUTO_EXPOSURE or CAP_PROP_AUTO_WB.
  • Practical approach used now: keep the Kinect color reader open through the sequence, warm/capture several frames, and include Kinect color in black/white reference frames and GrayCode decode.

Test run:

  • USB preset used: out\step_calibration_20260526\step05_usb_camera_controls_conservative_preset.json.
  • Left GrayCode: out\step_calibration_20260526\step06_graycode_left_locked_controls.
  • Right GrayCode: out\step_calibration_20260526\step07_graycode_right_locked_controls.
  • Both projectors captured 44/44 frames for usb_4, usb_5, usb_6, usb_7, kinect_color, and network.
  • Decode settings: sample_step=2, white=5, black=30, modulation=70.
  • Visual summary: out\step_calibration_20260526\step08_decode_locked_s2_m70_summary_contact.png.
  • Reference frame sheet: out\step_calibration_20260526\step08_reference_frames_contact.png.

Decode coverage:

  • Left:
    • usb_4: 93265/518400, 17.99%.
    • usb_5: 95736/518400, 18.47%.
    • usb_6: 23184/230400, 10.06%.
    • usb_7: 33428/230400, 14.51%.
    • kinect_color: 292690/518400, 56.46%.
    • network: 91110/518400, 17.58%.
  • Right:
    • usb_4: 123614/518400, 23.85%.
    • usb_5: 74989/518400, 14.47%.
    • usb_6: 15886/230400, 6.89%.
    • usb_7: 33057/230400, 14.35%.
    • kinect_color: 279650/518400, 53.94%.
    • network: 57354/518400, 11.06%.

Interpretation:

  • Kinect color is now the strongest single 2D decode source and should be used as a primary observation source for the next 2D-to-3D surface solve.
  • USB and network views remain useful for cross-camera validation and seam/edge constraints, but the network camera right-projector decode is weaker in this run.

2026-05-26 - Bright-Room 2s GrayCode Retest

The user turned on room lights and requested a faster GrayCode run:

  • frame hold: 2 seconds
  • USB preset: out\step_calibration_20260526\step09_usb_camera_controls_bright_room_preset.json
  • no Kinect saturation filter
  • same decode thresholds as the denser run: sample_step=2, white=5, black=30, modulation=70

Captures:

  • Left: out\step_calibration_20260526\step10_graycode_left_bright_2s
  • Right: out\step_calibration_20260526\step11_graycode_right_bright_2s

Both left and right captured 44/44 frames for usb_4, usb_5, usb_6, usb_7, kinect_color, and network.

Decode summary:

  • Image: out\step_calibration_20260526\step12_decode_bright_2s_s2_m70_summary_contact.png
  • JSON: out\step_calibration_20260526\step12_decode_bright_2s_s2_m70_summary.json

Valid points:

  • Left:
    • usb_4: 87245/518400, 16.8%.
    • usb_5: 71931/518400, 13.9%.
    • usb_6: 51640/230400, 22.4%.
    • usb_7: 58103/230400, 25.2%.
    • kinect_color: 76218/518400, 14.7%.
    • network: 99650/518400, 19.2%.
  • Right:
    • usb_4: 109439/518400, 21.1%.
    • usb_5: 64171/518400, 12.4%.
    • usb_6: 29709/230400, 12.9%.
    • usb_7: 56080/230400, 24.3%.
    • kinect_color: 75705/518400, 14.6%.
    • network: 82298/518400, 15.9%.

Interpretation:

  • Bright-room + 2s capture reduced the raw Kinect color valid count from the previous 4s dark-ish locked-control run, which supports the concern that the earlier Kinect count was inflated by high-contrast/exposed frames rather than reliable precision.
  • The C270 cameras (usb_6, usb_7) improved significantly with the bright-room preset and room lights.

2026-05-26 - Bright-Room Threshold Sweep

The user asked to tune decode thresholds on the just-captured bright-room 2-second GrayCode sequences to increase valid point count.

Input captures:

  • out\step_calibration_20260526\step10_graycode_left_bright_2s
  • out\step_calibration_20260526\step11_graycode_right_bright_2s

Sweep:

  • sample_step=2
  • first grid: white={3,5,8,10}, black={20,30,40,50}, modulation={40,50,60,70}
  • extra grid: white={12,15,20}, black=30, modulation={30,40,50}

Outputs:

  • out\step_calibration_20260526\step13_threshold_sweep_bright_2s
  • out\step_calibration_20260526\step13_threshold_sweep_bright_2s_extra
  • out\step_calibration_20260526\step13_threshold_sweep_bright_2s_selected_summary.json

Selected totals across all 12 camera/projector decodes:

  • Previous: white=5 black=30 modulation=70: 862189/5068800, 17.01%.
  • Safe increased: white=10 black=30 modulation=40: 1141541/5068800, 22.52%.
  • Balanced recommendation: white=15 black=30 modulation=40: 1262403/5068800, 24.91%.
  • Maximum-count diagnostic: white=20 black=30 modulation=30: 1342832/5068800, 26.49%.

Findings:

  • In this capture set, black threshold had no meaningful effect from 20 to 50.
  • Raising white increases valid count strongly.
  • Lowering modulation increases count slightly, but very low modulation increases fragmentation/noise risk.
  • Recommendation for the next production decode: white=15 black=30 modulation=40.
  • Use white=20 black=30 modulation=30 only for diagnostics or when visual masks confirm it does not admit noisy disconnected regions.

2026-05-26 - Safe Threshold Sample-Step 1 Decode

The user selected the safe thresholds and asked to try sample_step=1.

Settings:

  • sample_step=1
  • white=10
  • black=30
  • modulation=40

Outputs:

  • out\step_calibration_20260526\step14_decode_bright_2s_s1_safe_summary_contact.png
  • out\step_calibration_20260526\step14_decode_bright_2s_s1_safe_summary.json

Coverage:

  • Total: 4566442/20275200, 22.52%.
  • Left:
    • usb_4: 476430/2073600, 23.0%.
    • usb_5: 522020/2073600, 25.2%.
    • usb_6: 362782/921600, 39.4%.
    • usb_7: 336792/921600, 36.5%.
    • kinect_color: 327224/2073600, 15.8%.
    • network: 406252/2073600, 19.6%.
  • Right:
    • usb_4: 515354/2073600, 24.9%.
    • usb_5: 414846/2073600, 20.0%.
    • usb_6: 168801/921600, 18.3%.
    • usb_7: 333381/921600, 36.2%.
    • kinect_color: 306031/2073600, 14.8%.
    • network: 396529/2073600, 19.1%.

Interpretation:

  • sample_step=1 produced about 4x as many valid points as sample_step=2 at the same safe thresholds, with essentially the same ratio.
  • This is useful for denser final fitting if CSV size and processing time are acceptable.

2026-05-26 - Kinect Color Decode to 3D Bridge

The next step used the safe sample_step=1 Kinect color decodes and live Kinect depth to create projector-pixel to Kinect camera-space 3D samples.

Commands:

  • calibrator_cli --map-kinect-color-decode-to-3d out\step_calibration_20260526\step14_decode_left_kinect_color_bright_2s_s1_safe out\step_calibration_20260526\step15_projector_3d_left_kinect_s1_safe 4 4500
  • calibrator_cli --map-kinect-color-decode-to-3d out\step_calibration_20260526\step14_decode_right_kinect_color_bright_2s_s1_safe out\step_calibration_20260526\step15_projector_3d_right_kinect_s1_safe 4 4500

Outputs:

  • Left: out\step_calibration_20260526\step15_projector_3d_left_kinect_s1_safe
  • Right: out\step_calibration_20260526\step15_projector_3d_right_kinect_s1_safe
  • Contact sheet: out\step_calibration_20260526\step15_projector_3d_kinect_s1_safe_contact.png

Results:

  • Left: 317464/327224 matched, 97.02%.
  • Right: 306031/306031 matched, 100.00%.
  • Left bounds meters: X -0.069..2.172, Y -1.318..0.185, Z 2.729..3.906.
  • Right bounds meters: X -1.846..0.234, Y -1.361..0.185, Z 2.687..4.018.

Interpretation:

  • The 2D GrayCode to 3D Kinect bridge is healthy on the current bright-room capture.
  • Next step should create or refresh the screen-only Kinect segment, then filter these projector 3D samples against that segment before fitting the curved screen surface.

2026-05-26 - Kinect Screen Segment and Projector 3D Filtering

The next step refreshed the Kinect point cloud, segmented the screen, and filtered projector 3D samples to remove non-screen points.

Commands:

  • calibrator_cli --export-kinect2-point-cloud out\step_calibration_20260526\step16_kinect_point_cloud 1 4500
  • calibrator_cli --segment-kinect-screen out\step_calibration_20260526\step16_kinect_point_cloud out\step_calibration_20260526\step17_kinect_screen_segment -2.25 2.15 -0.55 0.25 1.25 3.45
  • calibrator_cli --filter-projector-3d-by-screen-segment out\step_calibration_20260526\step15_projector_3d_left_kinect_s1_safe out\step_calibration_20260526\step17_kinect_screen_segment out\step_calibration_20260526\step18_filtered_projector_3d_left_kinect_s1_safe 0.08
  • calibrator_cli --filter-projector-3d-by-screen-segment out\step_calibration_20260526\step15_projector_3d_right_kinect_s1_safe out\step_calibration_20260526\step17_kinect_screen_segment out\step_calibration_20260526\step18_filtered_projector_3d_right_kinect_s1_safe 0.08

Outputs:

  • Point cloud: out\step_calibration_20260526\step16_kinect_point_cloud
  • Screen segment: out\step_calibration_20260526\step17_kinect_screen_segment
  • Left filtered samples: out\step_calibration_20260526\step18_filtered_projector_3d_left_kinect_s1_safe
  • Right filtered samples: out\step_calibration_20260526\step18_filtered_projector_3d_right_kinect_s1_safe
  • Contact sheet: out\step_calibration_20260526\step18_kinect_screen_filter_contact.png

Results:

  • Kinect point cloud: 190155 points, 175159 colored.
  • Screen segment: 41467/190155 points, 21.81%, bounds X -2.136..1.960, Y -0.550..0.247, Z 2.573..3.449.
  • Left filtered projector samples: 203109/317464, 63.98%, mean nearest screen distance 0.00849 m.
  • Right filtered projector samples: 187311/306031, 61.21%, mean nearest screen distance 0.00784 m.

Interpretation:

  • The screen segmentation and 0.08 m distance filtering are numerically healthy on this bright-room dataset.
  • The filtered sample counts are dense enough for fitting a smooth screen surface.

2026-05-26 - Screen Surface Fit From Filtered 3D Samples

The next step fitted the smooth screen surface using filtered left/right projector 3D samples plus the Kinect screen segment.

Command:

calibrator_cli --fit-screen-surface out\step_calibration_20260526\step18_filtered_projector_3d_left_kinect_s1_safe out\step_calibration_20260526\step18_filtered_projector_3d_right_kinect_s1_safe out\step_calibration_20260526\step17_kinect_screen_segment out\step_calibration_20260526\step19_screen_surface_fit_s1_safe 128 40

Outputs:

  • out\step_calibration_20260526\step19_screen_surface_fit_s1_safe
  • out\step_calibration_20260526\step19_screen_surface_fit_s1_safe_contact.png

Results:

  • Model: oriented_cylindrical_arc_pca_axis.
  • Inputs: left 203109, right 187311, screen 41467, total 431887.
  • Robust fit inliers: 431606.
  • Circle/cylinder center (0.0395, -2.7403), radius 2.9791 m.
  • Residual RMS:
    • left: 0.0484 m
    • right: 0.0447 m
    • screen: 0.0472 m
    • all: 0.0467 m
  • Mesh: 128 x 40, 5120 vertices, 9906 faces.

Interpretation:

  • The fit is sufficient to generate the next prototype surface warp mesh.
  • The residual is still large for final projection precision. Treat the next warp as a visual diagnostic, not a final calibration. Likely causes: Kinect depth noise, screen material thickness/folds/edge clutter, segment bounds, and the simple cylindrical surface model.

2026-05-26 - Surface Warp Mesh, Hybrid Export, Alpha Blend

The next step generated per-projector surface warp meshes, hybrid full-frame exports, and alpha blend masks from the safe sample_step=1 dataset.

Commands:

  • calibrator_cli --build-surface-warp-mesh out\step_calibration_20260526\step18_filtered_projector_3d_left_kinect_s1_safe out\step_calibration_20260526\step19_screen_surface_fit_s1_safe out\step_calibration_20260526\step20_surface_warp_left_s1_safe 96 54 180
  • calibrator_cli --build-surface-warp-mesh out\step_calibration_20260526\step18_filtered_projector_3d_right_kinect_s1_safe out\step_calibration_20260526\step19_screen_surface_fit_s1_safe out\step_calibration_20260526\step20_surface_warp_right_s1_safe 96 54 180
  • calibrator_cli --export-hybrid-surface-warp out\step_calibration_20260526\step20_surface_warp_left_s1_safe out\step_calibration_20260526\step21_hybrid_surface_warp_left_s1_safe 1920 1080
  • calibrator_cli --export-hybrid-surface-warp out\step_calibration_20260526\step20_surface_warp_right_s1_safe out\step_calibration_20260526\step21_hybrid_surface_warp_right_s1_safe 1920 1080
  • calibrator_cli --generate-surface-alpha-blend out\step_calibration_20260526\step21_hybrid_surface_warp_left_s1_safe out\step_calibration_20260526\step21_hybrid_surface_warp_right_s1_safe out\step_calibration_20260526\step22_alpha_blend_s1_safe 2.2

Outputs:

  • Left mesh: out\step_calibration_20260526\step20_surface_warp_left_s1_safe
  • Right mesh: out\step_calibration_20260526\step20_surface_warp_right_s1_safe
  • Left hybrid: out\step_calibration_20260526\step21_hybrid_surface_warp_left_s1_safe
  • Right hybrid: out\step_calibration_20260526\step21_hybrid_surface_warp_right_s1_safe
  • Alpha blend: out\step_calibration_20260526\step22_alpha_blend_s1_safe
  • Contact sheet: out\step_calibration_20260526\step22_surface_warp_hybrid_blend_contact.png

Results:

  • Left mesh: 96 x 54, valid vertices 5184/5184, projector bounds (83,0)-(1919,686), mean nearest projector distance 1.73 px, max 47.04 px.
  • Right mesh: 96 x 54, valid vertices 5184/5184, projector bounds (0,0)-(1919,703), mean nearest projector distance 6.01 px, max 138.85 px.
  • Left hybrid: active pixels 1262019, active ratio 60.86%.
  • Right hybrid: active pixels 1351680, active ratio 65.19%.
  • Alpha blend overlap theta (1.52111, 1.61416), gamma 2.2.

Interpretation:

  • This is the next diagnostic warp artifact. It should now be projected as a hybrid surface check and visually inspected before any claim of calibration quality.
  • The right mesh has a larger max nearest projector distance, so expect the right side/edge to be the most likely source of visible error.

2026-05-26 - Hybrid Surface Check Projection Capture

The hybrid surface check was projected on both projectors and captured with all current cameras.

Projection command:

calibrator_cli --project-hybrid-surface-check 1 2 out\step_calibration_20260526\step21_hybrid_surface_warp_left_s1_safe out\step_calibration_20260526\step21_hybrid_surface_warp_right_s1_safe 90 out\step_calibration_20260526\step22_alpha_blend_s1_safe

Capture output:

  • out\step_calibration_20260526\step23_hybrid_surface_check_projection
  • Contact sheet: out\step_calibration_20260526\step23_hybrid_surface_check_projection\step23_hybrid_surface_check_contact.png

Captured:

  • usb_4.png
  • usb_5.png
  • usb_6.png
  • usb_7.png
  • network.png
  • kinect_color.png

Observation:

  • Pattern was captured successfully by all sources.
  • The surface-space check grid is readable.
  • Lower screen area is still blank because current hybrid exports are observed mode:
    • left observed bounds (83,0)-(1919,686)
    • right observed bounds (0,0)-(1919,703)
  • Therefore the missing lower image is expected from the current trusted-region policy. It is not a projection-window timing/capture failure.

Next decision:

  • Evaluate only observed-region warp quality, or generate a diagnostic extrapolated/full export to visually fill the lower projector frame. The final safe output should still keep masks for unobserved regions.

2026-05-26 - Full No-Mask Hybrid Surface Check Diagnostic

The user asked to display the warp without masks on the full screen to understand the missing lower image.

Commands:

  • calibrator_cli --export-hybrid-surface-warp out\step_calibration_20260526\step20_surface_warp_left_s1_safe out\step_calibration_20260526\step24_hybrid_surface_warp_left_s1_safe_full 1920 1080 full
  • calibrator_cli --export-hybrid-surface-warp out\step_calibration_20260526\step20_surface_warp_right_s1_safe out\step_calibration_20260526\step24_hybrid_surface_warp_right_s1_safe_full 1920 1080 full
  • calibrator_cli --project-hybrid-surface-check 1 2 out\step_calibration_20260526\step24_hybrid_surface_warp_left_s1_safe_full out\step_calibration_20260526\step24_hybrid_surface_warp_right_s1_safe_full 90

Capture output:

  • out\step_calibration_20260526\step25_hybrid_surface_check_full_nomask_projection
  • Contact sheet: out\step_calibration_20260526\step25_hybrid_surface_check_full_nomask_projection\step25_hybrid_surface_check_full_nomask_contact.png

Findings:

  • The lower part of the screen is now filled, confirming the previous blank area was caused by the observed-region mask/trust bounds, not a projector-window or capture timing problem.
  • The full extrapolated area shows obvious lower-region artifacts/rectangular patches and should be treated only as a diagnostic view.
  • Final export should still use masks or improve observed data coverage before trusting the lower screen.

2026-05-26 - Missing Lower Screen Root Cause and Tall Segment Fix

The user asked to investigate why the lower screen was missing. The pipeline was traced stage by stage:

  • step14 Kinect color decode had projector Y coverage 0..1079.
  • step15 Kinect color decode to 3D also had projector Y coverage 0..1079.
  • step18 filtered projector samples only had projector Y up to 686 left and 703 right.

Root cause:

  • The screen segment bound used minY=-0.55 m.
  • The lower projector pixels map to Kinect camera-space Y around:
    • left: down to about -1.25 m
    • right: down to about -1.16 m
  • Therefore the screen-distance filter removed the lower projector samples.

Fix tested:

  • New screen segment:
    • out\step_calibration_20260526\step26b_kinect_screen_segment_tall_zscreen
    • bounds: X -2.25..2.15, Y -1.35..0.25, Z 2.50..3.65
    • points: 75132/190155
  • New filtered samples:
    • left: 316788/317464, 99.79%
    • right: 305883/306031, 99.95%
  • New surface fit:
    • out\step_calibration_20260526\step28_screen_surface_fit_tall_zscreen_s1_safe
    • RMS all 0.0301 m, left 0.0230 m, right 0.0191 m, screen 0.0686 m
  • New meshes:
    • left mean nearest projector distance 3.29 px
    • right mean nearest projector distance 2.80 px
  • New observed hybrid exports:
    • left active ratio 99.11%, bounds (17,0)-(1919,1079)
    • right active ratio 100%, bounds (0,0)-(1919,1079)
  • New projection capture:
    • out\step_calibration_20260526\step32_hybrid_surface_check_tall_zscreen_projection\step32_hybrid_surface_check_tall_zscreen_contact.png

Conclusion:

  • The missing lower image was not caused by GrayCode decode or projector display output.
  • It was caused by screen segmentation bounds that were too high vertically.
  • The tall Z-constrained screen segment fills the lower screen in observed/masked mode and improves projector-sample RMS. The next step is visual/geometric seam evaluation and smoothing/constraints if needed.

2026-05-26 - Boundary-Aware Surface Check Diagnostic

The user observed that horizontal check lines are not parallel to the physical screen borders and asked to try a fix.

Implemented:

  • --project-hybrid-surface-check now computes local top/bottom axis curves from the active PFM samples across surface-theta bins.
  • The check pattern vertical coordinate is normalized between those local boundary curves instead of using one global minAxis/maxAxis range.
  • This is a diagnostic change to the check pattern only; it does not alter the exported warp geometry.

Outputs:

  • Captured check: out\step_calibration_20260526\step34_boundary_aware_surface_check_projection\step34_boundary_aware_surface_check_contact.png
  • Live projection PID/session: out\step_calibration_20260526\step35_live_boundary_aware_surface_check

Interpretation:

  • The change tests whether vertical-coordinate parameterization is the cause of non-parallel horizontal lines.
  • Initial captured views suggest this alone is not enough for a final fix. The next stronger approach should detect real top/bottom screen boundaries from camera/marker observations and feed those boundary constraints into the surface UV/warp solve, rather than only remapping the diagnostic pattern.

2026-05-26 - Boundary-Aware Diagnostic Reverted

The user observed the boundary-aware diagnostic made the display worse:

  • top projection did not fill the full area;
  • horizontal lines were still not parallel to screen boundaries.

Action:

  • Reverted mapping commit dde867b with revert commit dcd8a6c.
  • Rebuilt calibrator_cli.
  • Re-projected the previous check using the tall screen segment outputs:
    • out\step_calibration_20260526\step36_live_reverted_surface_check

Current conclusion:

  • Do not pursue PFM-derived top/bottom axis normalization as the main fix.
  • The problem is likely in the surface coordinate/UV solve and lack of real screen-boundary constraints, not merely in check-pattern normalization.
  • Next direction: detect actual top/bottom/side screen edges from camera images or dense marker grid observations, then use those edges as boundary constraints in the warp/surface solve.

2026-05-26 - Upright Kinect-Y Surface Frame Diagnostic

To test whether the fitted PCA screen axis caused horizontal-line tilt, a diagnostic upright surface frame mode was added to --build-surface-warp-mesh.

Implementation:

  • Optional final argument after full projector width/height: upright.
  • In upright mode, the mesh still uses the fitted XZ cylinder, but disables the oriented screen frame so vertical surface coordinate becomes Kinect/world Y.

Commands:

  • calibrator_cli --build-surface-warp-mesh ... step37_surface_warp_left_upright_s1_safe 96 54 180 1920 1080 upright
  • calibrator_cli --build-surface-warp-mesh ... step37_surface_warp_right_upright_s1_safe 96 54 180 1920 1080 upright
  • Exported to step38_hybrid_surface_warp_*_upright_s1_safe.
  • Blended to step39_alpha_blend_upright_s1_safe.
  • Captured projection to step40_upright_surface_check_projection.
  • Live projection: step41_live_upright_surface_check.

Results:

  • Left mesh mean nearest projector distance: 4.03 px.
  • Right mesh mean nearest projector distance: 2.80 px.
  • Both hybrid exports are full 1920x1080 observed coverage.
  • Captured check: out\step_calibration_20260526\step40_upright_surface_check_projection\step40_upright_surface_check_contact.png.

Observation:

  • The upright variant looks very similar to the oriented variant and does not strongly fix horizontal-line alignment.
  • Conclusion: tilted PCA axis is not the only/main problem. The solver needs explicit physical screen edge/marker boundary constraints.

2026-05-26 - Upright Diagnostic Reverted

The user observed the upright variant became worse and asked to return to the previous variant.

Action:

  • Reverted mapping commit 1dc77f2 with revert commit 4407c57.
  • Rebuilt calibrator_cli.
  • Stopped the upright live projection.
  • Re-projected the last stable tall-zscreen oriented output:
    • out\step_calibration_20260526\step42_live_reverted_after_upright_check

Current stable output:

  • Left hybrid: out\step_calibration_20260526\step30_hybrid_surface_warp_left_tall_zscreen_s1_safe
  • Right hybrid: out\step_calibration_20260526\step30_hybrid_surface_warp_right_tall_zscreen_s1_safe
  • Blend: out\step_calibration_20260526\step31_alpha_blend_tall_zscreen_s1_safe

Conclusion:

  • Boundary-aware check-pattern normalization and upright surface frame both failed to solve the horizontal-line/border-parallel problem.
  • The next path should be observation-driven: detect real screen borders or use dense marker-grid observations, then add boundary constraints to the surface/projector solve.

2026-05-26 - Marker Grid Boundary Observation Test

The user agreed to try observation-driven boundary constraints. The first test projected raw marker grids on both projectors and captured all cameras.

Attempt 1: dense grid

  • Left generated: out\step_calibration_20260526\step43_marker_grid_left_raw
  • Right generated: out\step_calibration_20260526\step43_marker_grid_right_raw
  • Grid: 24 x 14, marker scale 1.0, margin 0.0
  • Capture: out\step_calibration_20260526\step44_marker_grid_boundary_capture
  • Result: too dense; most cameras detected 0..1 markers.

Attempt 2: readable grid

  • Left generated: out\step_calibration_20260526\step45_marker_grid_left_raw_12x7, IDs 84..167
  • Right generated: out\step_calibration_20260526\step45_marker_grid_right_raw_12x7, IDs 168..251
  • Grid: 12 x 7, marker scale 1.0, margin 0.06
  • Capture/detection: out\step_calibration_20260526\step46_marker_grid_boundary_capture_12x7
  • Contact sheet: out\step_calibration_20260526\step46_marker_grid_boundary_capture_12x7\step46_marker_grid_detection_contact.png
  • Summary JSON: out\step_calibration_20260526\step46_marker_grid_boundary_capture_12x7\marker_boundary_detection_summary.json

Detection counts:

  • usb_4: total 91, left 36, right 55.
  • usb_5: total 69, left 54, right 15.
  • usb_6: total 69, left 58, right 11.
  • usb_7: total 71, left 17, right 54.
  • network: total 121, left 59, right 62.
  • kinect_color: total 121, left 58, right 63.

Interpretation:

  • 12 x 7 is a usable density for projected marker detection.
  • network and kinect_color are the strongest global observation sources for both projectors.
  • Top and bottom rows are detected well enough to build initial top/bottom boundary curves.
  • Extreme side columns are weak, so left/right edge constraints should come later or use a dedicated border pattern.

2026-05-26 - Marker Boundary Observation Files

The detected 12 x 7 marker grids were joined with the generated marker manifests to create projector/camera observation data.

Output:

  • out\step_calibration_20260526\step48_marker_boundary_observations_12x7

Files:

  • marker_boundary_observations_report.json
  • marker_projector_camera_observations.csv
  • boundary_row_candidates.csv
  • boundary_consensus_projector_points.csv
  • marker_boundary_observation_contact.png
  • left_boundary_votes_projector_preview.png
  • right_boundary_votes_projector_preview.png

Result:

  • Joined observations: 542.
  • The files now link:
    • marker ID
    • projector side
    • projector row/column/cell center
    • camera center/corners

Interpretation:

  • This is useful for building observation-driven constraints, but it is not yet direct physical edge detection.
  • Marker row visibility tells which projector cells are visible/readable, but top/bottom physical screen boundaries require a dedicated edge/border pattern or marker-grid pattern with explicit border lines.

2026-05-26 - Marker Grid With Colored Border Lines

Projected a 12 x 7 ArUco-style marker grid with explicit colored border/guide lines to see whether one frame could both identify marker cells and reveal physical screen edges.

Output:

  • Pattern: out\step_calibration_20260526\step49_marker_border_pattern_12x7
  • Capture/detection: out\step_calibration_20260526\step50_marker_border_capture_12x7
  • Contact sheet: out\step_calibration_20260526\step50_marker_border_capture_12x7\step50_marker_border_detection_contact.png
  • Summary JSON: out\step_calibration_20260526\step50_marker_border_capture_12x7\marker_border_detection_summary.json

Detection counts:

  • usb_4: total 76, left 30, right 46.
  • usb_5: total 60, left 45, right 15.
  • usb_6: total 55, left 47, right 8.
  • usb_7: total 61, left 16, right 45.
  • network: total 91, left 45, right 46.
  • kinect_color: total 91, left 45, right 46.

Interpretation:

  • The colored border lines are visible in captures and useful for human/algorithmic edge inspection.
  • Marker detection dropped compared to the plain 12 x 7 grid (network/kinect_color were 121 before, now 91), because thick colored lines interfere with marker cells and edges.
  • Do not combine marker ID correspondences and physical edge extraction in one dense frame. Prefer a two-frame boundary solve:
    • plain marker grid for stable marker ID/projector/camera correspondences;
    • clean border-only or edge-line frame for real screen boundary extraction.

2026-05-26 - Clean Border-Only Diagnostic

Generated and projected a separate border-only frame with no markers. It uses a gray fill, colored outer lines, horizontal/vertical guide lines, diagonals, and center circles.

Output:

  • Pattern: out\step_calibration_20260526\step51_clean_border_pattern
  • Manual capture: out\step_calibration_20260526\step52_clean_border_capture_manual
  • Contact sheet: out\step_calibration_20260526\step52_clean_border_capture_manual\step52_clean_border_contact.png
  • Overlay contact: out\step_calibration_20260526\step52_clean_border_capture_manual\step52_clean_border_overlay_contact.png
  • Summary JSON: out\step_calibration_20260526\step52_clean_border_capture_manual\clean_border_capture_summary.json

Capture results:

  • usb_4: 1920x1080, mean 105.73, stddev 41.71.
  • usb_5: 1920x1080, mean 109.81, stddev 37.37.
  • usb_6: 1280x720, mean 125.02, stddev 39.03.
  • usb_7: 1280x720, mean 129.62, stddev 33.48.
  • network: 1920x1080, mean 116.84, stddev 54.26.
  • kinect_color: 1920x1080, mean 148.50, stddev 57.96.

Operational note:

  • --probe-hardware hung after capturing USB images during the first attempt. It was stopped and the diagnostic was re-captured with explicit per-camera commands: --capture-camera, --capture-network-camera, and --capture-kinect2-color.

Interpretation:

  • This clean frame is more suitable than marker+border for visual line/border diagnosis.
  • A naive global brightness/saturation edge mask is not enough because it includes background walls/metal and returns full-frame bounding boxes.
  • For the next boundary solver, crop/weight the camera image using marker-grid observations first, then fit the known colored guide lines or the screen top/bottom curves inside that ROI.

2026-05-26 - ROI-Constrained Border Line Extraction

Tested the intended two-frame approach: use the plain marker-grid detections to define each camera's screen ROI, then detect clean border/guide lines inside that ROI only.

Output:

  • out\step_calibration_20260526\step53_roi_border_line_extraction
  • Contact sheet: out\step_calibration_20260526\step53_roi_border_line_extraction\step53_roi_border_line_contact.png
  • Summary JSON: out\step_calibration_20260526\step53_roi_border_line_extraction\roi_border_line_summary.json

Method:

  • Marker ROI input: out\step_calibration_20260526\step46_marker_grid_boundary_capture_12x7.
  • Clean border input: out\step_calibration_20260526\step52_clean_border_capture_manual.
  • The script built a per-camera ROI from detected marker corners, then ran Hough line extraction on color/brightness masks only inside that ROI.

Result:

  • ROI cropping successfully removed most background wall/metal false positives.
  • network and kinect_color are the strongest full-screen cameras for this boundary solve.
  • USB cameras are useful as local checks, but their ROI is partial/narrower.

Interpretation:

  • The two-frame approach is valid:
    • marker grid gives stable projector/camera ROI and correspondences;
    • clean border frame gives line/boundary observations.
  • The next real correction should fit top/bottom curves inside these ROIs and apply a smooth boundary correction to the warp instead of changing the surface frame heuristically.

2026-05-26 - First Boundary-Normalized Check Projection

Generated an experimental check image using network and kinect_color as the main global cameras. This was a diagnostic projection only, not a replacement for the stable hybrid PFM.

Output:

  • Pattern: out\step_calibration_20260526\step54_boundary_normalized_check
  • Captured projection: out\step_calibration_20260526\step55_boundary_normalized_check_projection
  • Contact sheet: out\step_calibration_20260526\step55_boundary_normalized_check_projection\step55_boundary_normalized_check_contact.png
  • Live projection directory: out\step_calibration_20260526\step56_live_boundary_normalized_check

Method:

  • Marker ROI/correspondence source: step46_marker_grid_boundary_capture_12x7.
  • Boundary line source: step53_roi_border_line_extraction.
  • Decode source: step14_decode_*_bright_2s_s1_safe.
  • The check image normalized camera-space vertical coordinates between the fitted top/bottom border-line curves from network and kinect_color, then scattered that desired camera-space table back to projector space.

Fit summary:

  • Left: 146534 samples, RMS 0.0823 uv, median 0.0622 uv.
  • Right: 183090 samples, RMS 0.0851 uv, median 0.0647 uv.

Observation:

  • The captured check does not show a clear improvement over the stable tall-zscreen surface check. Seam/line alignment remains visibly problematic.
  • Do not promote this first boundary-normalized diagnostic to final warp generation.

Next interpretation:

  • The current line fits are still derived from projected guide lines, not a clean independent measurement of the physical screen edge.
  • The next solver should separately extract real physical top/bottom screen edges, then use those curves as boundary constraints while preserving marker correspondences and overlap continuity.

2026-05-26 - Reverted Live Projection To Stable Tall-Zscreen Check

The user rejected the boundary-normalized diagnostic as another non-improvement. The live projection was returned to the stable tall-zscreen surface check.

Actions:

  • Stopped experimental live projection from out\step_calibration_20260526\step56_live_boundary_normalized_check.
  • Restarted stable projection in out\step_calibration_20260526\step57_live_reverted_to_stable_tall_zscreen.

Stable inputs:

  • Left hybrid: out\step_calibration_20260526\step30_hybrid_surface_warp_left_tall_zscreen_s1_safe
  • Right hybrid: out\step_calibration_20260526\step30_hybrid_surface_warp_right_tall_zscreen_s1_safe
  • Blend: out\step_calibration_20260526\step31_alpha_blend_tall_zscreen_s1_safe

Conclusion:

  • Boundary-aware check normalization, upright frame, and boundary-normalized check-image generation have all failed to provide a clear improvement.
  • Do not keep trying visual/check-image heuristics. The next step should be a design pause around the real calibration model: independent screen geometry, physical edge constraints, projector/camera intrinsics/extrinsics, and overlap/seam consistency.

2026-05-26 - Fresh Step-By-Step Recalibration Started

The user requested a full restart, strictly step-by-step. New root:

  • out\recalibration_20260526_step_by_step

Step 00:

  • Output: step00_hardware_state
  • Displays:
    • DISPLAY1 / CLI index 0: primary monitor.
    • DISPLAY2 / CLI index 1: candidate projector.
    • DISPLAY3 / CLI index 2: candidate projector.
  • Cameras:
    • usb_4: 1920x1080
    • usb_5: 1920x1080
    • usb_6: 1280x720
    • usb_7: 1280x720
    • network: 1920x1080
    • kinect_color: 1920x1080

Step 01:

  • Output: step01_projector_layout
  • Confirmed:
    • DISPLAY2 / CLI index 1 / marker 10: left projector.
    • DISPLAY3 / CLI index 2 / marker 11: right projector.

Step 02:

  • Captured GrayCode with layout selection and frameHoldMs=2000.
  • Left output: step02_graycode_left, all active cameras 44/44.
  • Right output: step02_graycode_right, all active cameras 44/44.

Step 03:

  • Decoded with sample_step=1, white=5, black=30, modulation=70.
  • Summary: step03_decode_summary.json.
  • Contact: step03_decode_contact.png.

Valid points:

  • Left network: 402012
  • Left kinect_color: 313356
  • Left usb_4: 322192
  • Left usb_5: 261609
  • Left usb_6: 126259
  • Left usb_7: 136002
  • Right network: 382138
  • Right kinect_color: 370118
  • Right usb_4: 456496
  • Right usb_5: 271155
  • Right usb_6: 67782
  • Right usb_7: 266384

Recommendation:

  • Use network for overview QA.
  • Use kinect_color for the 2D-to-3D bridge.
  • Use usb_4/usb_5 as useful left local cameras.
  • Use usb_4/usb_7 as useful right local cameras.
  • Do not make right usb_6 primary; it has low valid count and narrow coverage.