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/status.md

83 KiB

Mapping Project Status

Goal

Create a new open-source automatic projection calibration module for Unreal Engine nDisplay, producing software-compatible warp and blend outputs for a curved screen with two projectors, two USB cameras, and Kinect 2.0.

Current State

  • Project requirements were captured from the user on 2026-05-24.
  • Local working directory is expected to be C:\git\mappping.
  • C:\git\mappping is now a Git repository on branch main.
  • Remote repository was created at ssh://wuu@192.168.1.66:22/srv/git/mapping.git.
  • Initial scaffold commit 371291f864f3186a60ec27086002c929cfc1dabd was pushed to remote main.
  • Additional reference repositories were captured in docs/reference_repositories.md.
  • Step 01 hardware probe was implemented and pushed in commit 77b1a65: --list-cameras, --capture-camera, --list-displays, vcpkg.json, and docs/step_01_hardware_probe.md.
  • Step 01 was built and verified in commit 77a2bc0: vcpkg/OpenCV configured, CMakePresets.json added, --probe-hardware added, GrayCode and stub export smoke checks passed.
  • The new project should start clean instead of extending the old experimental ProjectionMapping tree.
  • Prior ProjectionMapping knowledge remains relevant for pitfalls, especially GrayCode capture, stereo top/bottom output assumptions, Kinect/manual alignment, and correspondence diagnostics.
  • Visual Studio CMake exists at C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe.
  • C:\git\vcpkg was installed and bootstrapped locally. opencv4[contrib] was installed through manifest mode after forcing VS 2022 with VCPKG_VISUAL_STUDIO_PATH.
  • Current confirmed display mapping:
    • Windows Settings monitor 1 / DISPLAY1 / CLI index 0: primary monitor at (0,0), 1920x1080@60.
    • Windows Settings monitor 2 / DISPLAY3 / CLI index 2: left projector at (1920,0), 1920x1080@60.
    • Windows Settings monitor 3 / DISPLAY2 / CLI index 1: right projector at (3840,0), 1920x1080@60.
  • Current observed OpenCV camera indices: 0-3 black 1920x1080, 4-5 confirmed by the user as the intended real USB cameras showing the curved screen at 640x480, 6-7 color-bar test streams at 1280x720.
  • Kinect 2.0 is visible to Windows: WDF KinectSensor Interface 0, Xbox NUI Sensor, Microphone Array (Xbox NUI Sensor), USB VID_045E&PID_02C4, status OK.
  • Microsoft Kinect SDK v2 is installed at C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409.
  • OpenCV camera index 10 is not Kinect; captured frame showed an OBS-style virtual camera placeholder.
  • Network snapshot camera support was added in mapping commit cc43e5e. The camera is currently reachable at 192.168.1.40 through an HTTP snapshot endpoint, but credentials and full URL must stay local and must not be committed.
  • Network snapshot capture was verified at 1920x1080; combined hardware probe with network camera wrote a valid JSON report.
  • Local secret handling was added in mapping commit ae48e55: .env.example is committed, .env.local is ignored, and local .env.local snapshot capture was verified.
  • Step 02 projector output was added in mapping commit eeb3122: --project-test-pattern and --project-graycode-frame can show fullscreen patterns on a selected Windows display index.
  • Step 02 smoke test on primary display index 0 succeeded for checker and GrayCode frame 0.
  • User verified that --project-graycode-frame 2 0 10 displays a black/white stripe image, as expected for GrayCode frame 0.
  • Step 03 projected pattern capture was added in mapping commit 7bdb471: --project-and-capture projects a pattern and captures USB cameras 4,5 plus optional network snapshot.
  • Step 03 smoke test on primary display index 0 captured USB 4, USB 5, and network camera, and wrote a valid project_capture_report.json.
  • Captured projector checks showed both projectors are visible to cameras, but the non-target projector continued showing colored content. Isolated capture mode was added in mapping commit a08b63c to blank non-target projectors.
  • Step 04 full GrayCode sequence capture was implemented and locally verified. --capture-graycode-sequence-isolated captured all 44 OpenCV GrayCode frames while blanking the opposite projector, then wrote per-camera frame folders, graycode_sequence_report.json, and contact sheets.
  • Verification on 2026-05-24 captured 44/44 frames with 0 failures for network, usb_4, and usb_5 for both projector outputs:
    • Left projector: Windows monitor 2 / DISPLAY3 / CLI display index 2 at (1920,0), blanking display index 1, output out\graycode_display2_sequence.
    • Right projector: Windows monitor 3 / DISPLAY2 / CLI display index 1 at (3840,0), blanking display index 2, output out\graycode_display1_sequence.
  • Visual review of contact sheets shows usable vertical/horizontal GrayCode bands. CLI index 2 illuminates the left/center screen region; CLI index 1 illuminates the right screen region. USB camera 5 sees the screen broadly; USB camera 4 is useful but more cropped/perspective-dependent.
  • Windows display names and CLI indices are not stable enough to trust across reboot/cable/GPU changes. Step 05 adds --verify-projector-layout, which projects centered display identity text plus an ArUco marker, blanks other candidates, captures USB/network cameras, decodes marker IDs from the camera images, and writes projector_layout_check.json plus contact sheets.
  • Step 05 ArUco verification on 2026-05-25 succeeded with candidates 2,1: current CLI index 2 is the left projector and current CLI index 1 is the right projector. The JSON had "expectedMarkerDetected": true for both candidates. Network snapshot capture appends a cache-busting query parameter to avoid stale images.
  • Step 06 GrayCode capture from verified layout was implemented and locally verified. --capture-graycode-sequence-from-layout reads projector_layout_check.json, requires expectedMarkerDetected=true, selects the current display by left, right, candidate:N, marker:N, or display:N, blanks the other candidate projector outputs, and records layoutSource in the GrayCode report.
  • Step 06 verification on 2026-05-25 captured 44/44 frames with 0 failures for network, usb_4, and usb_5 for both left and right selectors using out\projector_layout_check_aruco2\projector_layout_check.json.
  • Step 07 GrayCode decode diagnostics was implemented and locally verified. --decode-graycode-sequence reads a captured sequence and camera folder, calls OpenCV GrayCodePattern::getProjPixel, writes correspondences.csv, valid_mask.png, modulation.png, projector_x.png, projector_y.png, and decode_report.json.
  • Step 07 verification on 2026-05-25:
    • Left layout capture + usb_5, sample step 2, thresholds 5/40/80: 33,950 valid correspondences from 76,800 sampled pixels, valid ratio 0.442057.
    • Right layout capture + usb_4, sample step 2, thresholds 5/40/80: 28,131 valid correspondences from 76,800 sampled pixels, valid ratio 0.366289.
    • Visual diagnostics show smooth projector X/Y gradients on the screen region. The modulation threshold significantly reduced false points outside the projected screen.
  • Step 08 correspondence cleanup was folded into --decode-graycode-sequence: it now writes raw and cleaned correspondences, dilates the sampled valid mask, keeps the largest connected screen component, and outputs cleaned valid_mask.png/projector maps.
  • Step 08 verification on 2026-05-25:
    • Left + usb_5: raw 33,950 -> cleaned 32,859 correspondences; 19 components before cleanup; false side/bottom groups removed visually.
    • Right + usb_4: raw 28,131 -> cleaned 28,129 correspondences; 2 components before cleanup; almost no loss because the mask was already clean.
  • Step 09 first homography estimate was implemented and locally verified. --estimate-homography reads cleaned_correspondences.csv, estimates camera-to-projector homography with OpenCV RANSAC, and writes matrix/residual/inlier diagnostics.
  • Step 09 verification on 2026-05-25:
    • 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.
    • Residual maps show systematic error growth across the screen, especially on the right projector. This indicates curved-screen/non-planar geometry rather than random GrayCode failure; next model should be local grid/piecewise warp, not one global homography.
  • Step 10 local warp grid diagnostics was implemented and locally verified. --build-local-warp-grid reads cleaned_correspondences.csv, bins correspondences into camera-space cells, writes local_warp_grid.csv, density image, vector visualization, and coverage/displacement statistics.
  • Step 10 verification on 2026-05-25:
    • Left + usb_5, cell size 24: 269/391 valid cells, valid cell ratio 0.68798, 32,859 correspondences, mean normalized displacement 0.169048.
    • Right + usb_4, cell size 24: 226/460 valid cells, valid cell ratio 0.491304, 28,129 correspondences, mean normalized displacement 0.249276.
    • Vector visualizations are smooth and show strong local direction changes, especially on the right, confirming local/piecewise warp is the correct next path.
  • Step 11 projector coverage mask diagnostics was implemented and locally verified. --build-projector-coverage rasterizes cleaned correspondences in projector pixel space and writes raw/alpha/preview masks plus coverage statistics.
  • Step 11 verification on 2026-05-25:
    • 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).
    • These masks are diagnostic alpha/coverage masks only; morphology fills most of projector space and still preserves object/shadow holes near the bottom. Do not treat them as final blend/overlap masks.
  • Step 12 camera-space overlap detection was implemented and locally verified. --detect-overlap compares cleaned decode masks from the same camera and rasterizes the overlap back into each projector's pixel space.
  • Step 12 verification on 2026-05-25 used usb_5 for both projectors:
    • Right projector was decoded for usb_5: 10,639 cleaned correspondences, valid ratio 0.138529, bounds (0,0)-(675,1079).
    • Overlap between out\decode_left_usb5_clean and out\decode_right_usb5_clean: 3,434 camera overlap pixels, left overlap fraction 0.104507, right overlap fraction 0.322775.
    • Projector-space overlap masks covered about 0.116614 of the left projector and 0.118134 of the right projector after morphology.
    • Visual preview shows overlap in the expected vertical seam/stitch region. The next step should create alpha falloff gradients from this overlap, not just binary masks.
  • Step 13 first alpha blend masks were implemented and locally verified. --generate-alpha-blend reads the binary projector-space overlap masks and writes left/right alpha PNG masks plus preview images.
  • Step 13 verification on 2026-05-25:
    • Command: .\build\Release\calibrator_cli.exe --generate-alpha-blend out\overlap_usb5 out\alpha_usb5 1.0.
    • Left overlap alpha bounds: (1686,0)-(1919,1079), 241,811 overlap pixels.
    • Right overlap alpha bounds: (0,0)-(233,1079), 244,962 overlap pixels.
    • Output masks are 1920x1080, 8-bit, range 0-255.
    • Visual previews show the expected projector-space seam: left projector fades down at its right edge; right projector fades up at its left edge. This is still a diagnostic linear/gamma falloff, not final photometric compensation.
  • Step 14 first PFM warp prototype was implemented and locally verified. --generate-pfm-warp-prototype reads cleaned GrayCode correspondences and writes a diagnostic projector-space PFM lookup with channels [camera_u, camera_v, valid].
  • Step 14 verification on 2026-05-25:
    • Left command: .\build\Release\calibrator_cli.exe --generate-pfm-warp-prototype out\decode_left_usb5_clean out\pfm_left_usb5 3 9.
    • Right command: .\build\Release\calibrator_cli.exe --generate-pfm-warp-prototype out\decode_right_usb4_clean out\pfm_right_usb4 3 9.
    • Both outputs are PF PFM files, 1920x1080, little-endian scale -1.0, size 24,883,218 bytes.
    • Left: 32,859 accepted samples, sparse ratio 0.0158464, coverage ratio 0.956738, valid pixels 1,983,892.
    • Right: 28,129 accepted samples, sparse ratio 0.0135648, coverage ratio 0.959511, valid pixels 1,989,641.
    • Preview images show smooth projector-space lookup gradients with black holes matching previous coverage/shadow holes. This is not final nDisplay 3D warp geometry; it is a diagnostic lookup scaffold until depth/screen geometry is integrated.
  • Network overview camera IP was changed from 192.168.1.64 to 192.168.1.40 on 2026-05-25. Local .env.local was updated without committing credentials, and snapshot capture via env:MAPPING_NETWORK_CAMERA_URL was verified at 1920x1080.
  • Step 15 Kinect v2 probe was implemented and locally verified. --probe-kinect2 uses Microsoft Kinect SDK v2 directly and saves color, depth, and infrared diagnostics.
  • Step 15 verification on 2026-05-25:
    • Command: .\build\Release\calibrator_cli.exe --probe-kinect2 out\kinect_probe.
    • Kinect SDK v2 was found at C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409; CMake links Kinect20.lib when present.
    • Sensor open HRESULT 0x0; availableInitial=false, availableAfterCapture=true, streamsCaptured=true.
    • Color captured: 1920x1080, mean 136.348, stddev 58.0319.
    • Depth captured: 512x424, reliable range 500-4500 mm, valid pixels 185,567, depth range 1022-4500 mm.
    • Infrared captured: 512x424, preview mean 26.4273, stddev 11.0233.
    • Visual checks show RGB view of the curved screen, a usable depth heatmap of the curved surface, and an IR image. Next geometry step should map Kinect depth into color/camera/projector coordinates.
  • Step 16 Kinect v2 point cloud export was implemented and locally verified. --export-kinect2-point-cloud captures depth/color, uses Kinect SDK v2 ICoordinateMapper to convert depth pixels into camera-space XYZ meters, maps color where available, and writes ASCII PLY.
  • Step 16 verification on 2026-05-25:
    • Command: .\build\Release\calibrator_cli.exe --export-kinect2-point-cloud out\kinect_point_cloud 1 4500.
    • Depth input: 512x424, sampled pixels 217,088, stride 1.
    • Point cloud: 185,431 points, 171,218 colored points.
    • Bounds in Kinect camera space: min (-3.22499, -2.55469, 0.631), max (2.38352, 2.28927, 4.475) meters.
    • Outputs include kinect_point_cloud.ply, front/top preview PNGs, raw depth, depth preview, and color frame.
    • Visual front preview shows the scene/screen; top preview clearly shows the curved screen arc. Next step should segment the screen surface from the raw scene point cloud.
  • Step 17 Kinect screen segmentation was implemented and locally verified. --segment-kinect-screen reads the Kinect PLY point cloud, applies adjustable Kinect camera-space bounds, and writes a screen-only PLY plus front/top previews.
  • Step 17 verification on 2026-05-25:
    • Command: .\build\Release\calibrator_cli.exe --segment-kinect-screen out\kinect_point_cloud out\kinect_screen_segment.
    • Default bounds after tuning: x=-2.25..2.15, y=-0.55..0.25, z=1.25..3.45 meters.
    • 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. This is still a bounds-based segment; later fitting should reject residual outliers.
  • Step 18 Kinect RGB camera integration was implemented and locally verified. Kinect v2 color can now be used as an additional camera source named kinect_color in capture/layout/GrayCode workflows.
  • Step 18 verification on 2026-05-25:
    • Single capture: .\build\Release\calibrator_cli.exe --capture-kinect2-color out\kinect_color_check\color.png produced 1920x1080, mean 138.472, stddev 58.2602.
    • --probe-hardware out\hardware_probe_kinect_color 5 now writes a kinectColor section and kinect_color.png; verified 1920x1080, mean 142.226, stddev 58.4572.
    • Capture pipeline accepts +kinect in camera CSV arguments, e.g. 4,5,+kinect, and writes the camera as kinect_color.
    • --project-and-capture 0 checker out\project_capture_primary_kinect_color 1 4,5,+kinect captured USB 4, USB 5, and kinect_color.
    • Important nuance: Kinect SDK RGB frames were mirrored for calibration use. kinect_color capture outputs are now flipped horizontally before saving, while raw SDK color used for depth/color mapping remains unchanged.
    • Layout verification with --verify-projector-layout 2,1 out\projector_layout_check_kinect_color_flip2 2 4,5,+kinect succeeded: Kinect RGB decoded marker 10 for left/display index 2 and marker 11 for right/display index 1.
    • GrayCode smoke: --capture-graycode-sequence-from-layout ... left out\graycode_left_kinect_color_smoke2 +kinect captured 44/44 Kinect RGB frames after increasing first-frame warmup.
    • Kinect RGB decode: --decode-graycode-sequence out\graycode_left_kinect_color_smoke2 kinect_color out\decode_left_kinect_color_smoke2 4 5 40 80 produced 21,396 cleaned correspondences from 129,600 sampled pixels, valid ratio 0.165093, full projector bounds (0,0)-(1919,1079), and smooth projector X/Y diagnostics.
  • Step 19 network camera default pipeline participation was implemented and locally verified. If an explicit network URL is not passed, the CLI now tries MAPPING_NETWORK_CAMERA_URL from the process environment, then local ignored .env.local. The full URL/credentials are not written to reports.
  • Step 19 verification on 2026-05-25:
    • Layout command without explicit network URL: .\build\Release\calibrator_cli.exe --verify-projector-layout 2,1 out\projector_layout_check_network_default 2 4,5,+kinect.
    • The command automatically included network from local .env.local, alongside usb_4, usb_5, and kinect_color.
    • Layout report contact cameras: kinect_color, network, usb_4, usb_5.
    • Network camera decoded marker 10 for left/display index 2 and marker 11 for right/display index 1.
    • GrayCode command without explicit network URL: .\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.
    • The command captured 44/44 frames for network and 44/44 for kinect_color.
    • Network decode command: .\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.
    • Network decode produced 23,259 cleaned correspondences from 129,600 sampled pixels, valid ratio 0.179468, projector bounds (12,0)-(1919,1079), and smooth projector X diagnostics.
    • Passing none as the optional network argument disables network capture for a specific run.
  • Step 20 Kinect RGB decode to Kinect depth 3D bridge was implemented and locally verified. --map-kinect-color-decode-to-3d reads kinect_color GrayCode cleaned_correspondences.csv, captures a fresh Kinect depth frame, maps depth pixels through Kinect SDK ICoordinateMapper into raw color coordinates and camera-space XYZ, converts saved de-mirrored kinect_color X back into SDK color X, and writes projector-pixel-to-3D samples.
  • Step 20 verification on 2026-05-25:
    • 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.
    • Input correspondences: 21,396.
    • Matched 3D correspondences: 18,706, match ratio 0.874276.
    • Mean color/depth lookup search distance: 0.036274 px.
    • Kinect camera-space bounds: min (0.0954764, -1.16996, 2.674), max (1.96908, 0.173243, 3.54) meters.
    • Outputs include projector_3d_correspondences.csv, projector_3d_points.ply, projector_3d_top_preview.png, projector_3d_front_preview.png, projector_3d_color_preview.png, depth_preview.png, and projector_3d_report.json.
    • Visual previews show a curved screen arc/topology and a dense projector-covered region; right-edge extra/background points remain and should be rejected by the next screen-surface filtering/fitting step.
  • Full calibration session out\full_calibration_20260525_0335 was captured and verified on 2026-05-25 with all current sources: USB 4, USB 5, kinect_color, and default network.
    • Layout: candidate/display 2 / DISPLAY3 confirmed as left projector; candidate/display 1 / DISPLAY2 confirmed as right projector. Kinect RGB and network decoded markers for both projectors; USB 5 decoded left marker and USB 4 decoded right marker.
    • GrayCode capture: left and right each captured 44/44 frames for usb_4, usb_5, network, and kinect_color.
    • Main USB decodes: left usb_5 kept 32,835 samples, valid ratio 0.427539; right usb_4 kept 28,014 samples, valid ratio 0.364766.
    • Kinect RGB decodes: left 18,987 samples, valid ratio 0.146505; right 17,946 samples, valid ratio 0.138472.
    • Network decodes: left 23,226 samples, valid ratio 0.179213; right 13,435 samples, valid ratio 0.103665.
    • Kinect 3D bridge: left matched 16,624/18,987 samples, match ratio 0.875546; right matched 17,946/17,946, match ratio 1.0.
    • Fresh Kinect screen segment: 40,216/184,736 points kept, ratio 0.217694.
    • Overlap from USB 5 pair: camera overlap pixels 3,572, left mask fraction 0.108786, right mask fraction 0.358491; projector overlap ratios about 0.116 and 0.118.
    • PFM prototypes: left accepted 32,835 samples, coverage ratio 0.955885; right accepted 28,014 samples, coverage ratio 0.957506.
  • Step 21 projector 3D filtering against the Kinect screen segment was implemented and locally verified. --filter-projector-3d-by-screen-segment keeps projector-to-3D samples within a configurable nearest-neighbor distance of the segmented screen point cloud.
  • Step 21 verification on 2026-05-25 using session out\full_calibration_20260525_0335:
    • Left: kept 9,999/16,624 samples, keep ratio 0.60148, mean nearest screen distance 0.00908242 m, bounds (0.0955957, -0.627791, 2.631) to (1.93318, 0.17359, 3.429).
    • Right: kept 10,995/17,946 samples, keep ratio 0.612671, mean nearest screen distance 0.00787641 m, bounds (-1.72209, -0.628243, 2.773) to (0.367285, 0.18398, 3.435).
    • Top previews show clean left/right portions of the same curved screen arc after filtering. This is ready for a first smooth surface fitting step.
  • Step 22 first smooth screen surface fit was implemented and locally verified. --fit-screen-surface combines filtered left/right projector-to-3D samples with the Kinect screen segment, fits a vertical cylindrical arc in Kinect camera-space X/Z, runs a robust second pass, and writes a PLY mesh plus residual diagnostics.
  • Step 22 verification on 2026-05-25 using session out\full_calibration_20260525_0335:
    • 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.
    • Model: vertical_cylindrical_arc_xz.
    • Inputs: left 9,999, right 10,995, screen segment 40,216, total 61,210; robust fit inliers 61,171.
    • Circle fit in X/Z: center (0.011876, 0.416237), radius 2.95867 m.
    • Mesh: 128 x 40, 5,120 vertices, 9,906 faces.
    • RMS residuals: left 0.0286836 m, right 0.0303674 m, screen 0.0362382 m, all 0.0341005 m.
    • Outputs include screen_surface_mesh.ply, screen_surface_top_preview.png, screen_surface_front_preview.png, surface_fit_samples.csv, and screen_surface_report.json.
  • Step 23 surface-based projector warp mesh diagnostics were implemented and locally verified. --build-surface-warp-mesh reads filtered projector-to-3D samples and the fitted cylindrical screen surface, interpolates a regular projector-space grid, projects vertices back onto the screen surface, and writes a mesh carrying both 3D XYZ and projector UV/pixel attributes.
  • Step 23 verification on 2026-05-25 using session out\full_calibration_20260525_0335:
    • Left command: .\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.
    • Left result: input samples 9,999, grid 96 x 54, valid vertices 5,184/5,184, mean nearest projector distance 5.22542 px, max nearest distance 49.4364 px, observed projector bounds x=223..1919, y=0..698.
    • Right command: .\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.
    • Right result: input samples 10,995, grid 96 x 54, valid vertices 5,184/5,184, mean nearest projector distance 7.42829 px, max nearest distance 110.136 px, observed projector bounds x=2..1895, y=0..709.
    • Outputs include surface_warp_mesh.ply, surface_warp_vertices.csv, projector/top/front previews, and surface_warp_mesh_report.json.
    • Important limitation: meshes currently cover observed Kinect-filtered active regions, not the full 1920x1080 projector frame. Before final nDisplay export, decide whether to extrapolate to full frame or export observed active region with masks.
  • Step 24 hybrid full-frame surface warp export was implemented and locally verified. --export-hybrid-surface-warp exports a full-frame projector PFM while trusting only observed surface-warp pixels; outside observed region the PFM is zeroed and alpha mask is zero.
  • Step 24 verification on 2026-05-25 using session out\full_calibration_20260525_0335:
    • Left command: .\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.
    • Left result: full-frame 1920x1080, observed bounds (223,0)-(1919,698), active pixels 1,186,203, active ratio 0.57205, alpha nonzero pixels 1,186,203, beta nonzero pixels 0.
    • Right command: .\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.
    • Right result: full-frame 1920x1080, observed bounds (2,0)-(1895,709), active pixels 1,344,740, active ratio 0.648505, alpha nonzero pixels 1,344,740, beta nonzero pixels 0.
    • Outputs include surface_warp_full_frame_xyz.pfm, surface_warp_alpha_mask.png, surface_warp_beta_mask.png, surface_warp_full_frame_preview.png, and hybrid_surface_warp_report.json.
    • Current PFM channels are metric Kinect camera-space x_m,y_m,z_m; exact Unreal nDisplay PFM convention still needs verification before final naming/semantics are considered stable.
  • Step 25 visual projection checks were added:
    • --project-blend-check <left_display_index> <right_display_index> [seconds] shows a raw unwarped grid/circle table on both projectors.
    • --project-hybrid-surface-check <left_display_index> <right_display_index> <left_hybrid_dir> <right_hybrid_dir> [seconds] [alpha_blend_dir] generates the check image from the hybrid surface PFM/alpha data and optionally applies alpha blend masks.
    • Current session command: .\build\Release\calibrator_cli.exe --project-hybrid-surface-check 2 1 out\full_calibration_20260525_0335\hybrid_surface_warp_left out\full_calibration_20260525_0335\hybrid_surface_warp_right 120 out\full_calibration_20260525_0335\alpha_usb5.
  • After visual review, the raw projection showed no calculated warp/blend, and the first hybrid surface preview showed only the observed region with visibly wavy lines. Step 23 was updated to smooth projector-to-surface mapping with a degree-3 polynomial from projector coordinates to cylindrical surface coordinates instead of nearest-neighbor/IDW XYZ interpolation.
  • Smoothed verification outputs:
    • Left smooth mesh: out\full_calibration_20260525_0335\surface_warp_left_smooth, theta RMS 0.000894156, Y RMS 0.00267861 m.
    • Right smooth mesh: out\full_calibration_20260525_0335\surface_warp_right_smooth, theta RMS 0.000923297, Y RMS 0.00285035 m.
    • Smoothed hybrid exports: hybrid_surface_warp_left_smooth and hybrid_surface_warp_right_smooth.
    • Geometry-only visual command: .\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.
  • Step 26 surface-coordinate alpha blend was implemented and live-verified on the projectors/cameras. --generate-surface-alpha-blend <left_hybrid_dir> <right_hybrid_dir> <output_dir> [gamma] computes overlap in fitted cylindrical surface theta, writes left_alpha.png, right_alpha.png, preview images, and surface_alpha_blend_report.json.
  • Step 26 verification on 2026-05-25:
    • Command: .\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.
    • Overlap theta range: 1.45166..1.54312.
    • Left theta range/mean: 0.86594..1.54312, mean 1.20594; right theta range/mean: 1.45166..2.20525, mean 1.82387.
    • Live projection command: .\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.
    • Camera probe output: out\surface_alpha_smooth_probe. Network and USB camera images show much smoother grid lines and surface-aware brightness fade, but remaining seam misregistration around the center overlap. Next correction should be seam-local geometry/projector-registration refinement, not just alpha direction.
  • Step 27 full-frame extrapolated surface diagnostic was implemented after visual review showed blank left/bottom areas. The blank areas were caused by the observed-region alpha policy, not projector output failure: previous hybrid exports filled only observed bounds such as left x=223..1919, y=0..698.
  • Step 27 changes:
    • --build-surface-warp-mesh now accepts optional [projector_width projector_height] and can build the smooth polynomial surface grid over the full projector frame while still reporting which vertices are observed/trusted.
    • --export-hybrid-surface-warp now accepts optional [observed|full]. observed preserves the old trusted-mask behavior. full writes alpha=255 across the full projector frame using the extrapolated polynomial surface model and also writes surface_warp_observed_alpha_mask.png as diagnostics for trusted pixels.
  • Step 27 verification on 2026-05-25:
    • Left full smooth mesh: out\full_calibration_20260525_0335\surface_warp_left_full_smooth, grid 128x72, valid/trusted vertices 7007/9216.
    • Right full smooth mesh: out\full_calibration_20260525_0335\surface_warp_right_full_smooth, grid 128x72, valid/trusted vertices 7082/9216.
    • Full hybrid exports: left/right active pixels 2073600/2073600; observed/trusted pixels left 1568597, right 1585189.
    • Full alpha blend: out\full_calibration_20260525_0335\surface_alpha_full_smooth, overlap theta 1.448..1.54312.
    • Live projection command: .\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.
    • Camera probe output: out\surface_full_smooth_probe. Network and USB images confirm the check image now reaches the left edge and bottom. Remaining issue is seam/local geometry accuracy, not missing coverage.
  • Step 28 oriented cylinder screen coordinates were implemented after visual review showed the first problem is warp curvature: horizontal check lines were not parallel to the physical screen bend. The old surface model assumed the cylinder axis was exactly Kinect camera Y; the new model estimates a screen-local cylinder frame with PCA and stores screenFrame.origin, axis, radialU, and radialV.
  • Step 28 verification on 2026-05-25:
    • Oriented fit: out\full_calibration_20260525_0335\screen_surface_fit_oriented, model oriented_cylindrical_arc_pca_axis.
    • Estimated screen axis: [-0.0214249, 0.962567, -0.270194], showing a significant tilt relative to Kinect Y.
    • Oriented full meshes: surface_warp_left_oriented_full_smooth and surface_warp_right_oriented_full_smooth, both 128x72; trusted vertices left 7007/9216, right 7082/9216.
    • Oriented exports: hybrid_surface_warp_left_oriented_full_smooth, hybrid_surface_warp_right_oriented_full_smooth.
    • Oriented alpha: surface_alpha_oriented_full_smooth, overlap theta 1.55912..1.65569.
    • Live projection command: .\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.
    • Camera probe output: out\surface_oriented_full_probe. Review shows horizontal lines now follow the screen-local cylinder coordinate better than the Kinect-Y model, but local warp/seam errors remain. Next work should refine projector-to-surface mapping using camera-observed line/feature alignment, not blend tuning.
  • A follow-up boundary-linear normalization experiment was attempted for the right-side vertical-line skew and rejected. Output out\surface_boundary_full_probe showed a severe wrong lower duplicate/warped region. The temporary code was reverted and not committed. Do not reuse simple linear boundary normalization as-is; fix right-edge skew through camera-observed local warp optimization.
  • Step 29 dense marker-grid projection was implemented to support display identity, screen-boundary detection, and future camera-observed local warp correction.
    • Commands:
      • --generate-marker-grid <display_index> <output_dir> [columns] [rows]
      • --project-marker-grid <display_index> [seconds] [columns] [rows]
      • --detect-marker-grid <image_path> <output_dir>
    • Uses OpenCV ArUco DICT_5X5_1000. Default tested grid is 20x11 markers. Each display gets a unique id block derived from CLI display index; current left display 2 generated ids 440..659, right display 1 generated ids 220..439.
    • Offline self-detection after removing decorative text labels: left/right generated PNGs detect 220/220 markers.
    • Live left-projector test command: .\build\Release\calibrator_cli.exe --project-marker-grid 2 120 20 11, camera probe out\marker_grid_left_live_probe.
    • Live detections from left projector: network camera 73 markers, USB camera4 61 markers, USB camera5 178 markers. This is enough to start estimating visible marker boundary/coverage and a local correction field, while network-camera readability may need a larger-marker mode.
  • Step 30 dense marker parameters were added for boundary/photo workflows. --generate-marker-grid and --project-marker-grid now accept optional [marker_scale] [white_margin_scale]; manifest CSV includes exact marker bounding boxes as well as cell bounds.
    • Default marker scale is now 0.54, white margin scale 0.06.
    • Dense-photo test: 24x13, marker scale 0.50, white margin 0.04, generated 312 markers per projector with no gaps between color cells.
    • Offline self-detection for dense PNGs: 312/312 for left and right.
    • Live left-projector dense test on current cameras: network 5, USB camera4 13, USB camera5 32. This is too dense for the current camera positions/resolution, but remains useful for high-resolution camera/photo import or after adding more USB cameras. Keep 20x11 as current reliable live default.
  • Step 31 monochrome marker-grid mode was implemented and is now the default. Color cell backgrounds are removed unless color is explicitly passed; this greatly improves live detection.
    • Commands now accept final optional [mono|color].
    • Tested mono dense command: .\build\Release\calibrator_cli.exe --project-marker-grid 2 120 24 13 0.72 0.03 mono.
    • Offline mono dense PNG detection: left/right 312/312.
    • Live mono dense left-projector detection on current cameras: network 180, USB camera4 91, USB camera5 249. This is a major improvement over color dense (5/13/32) and should be the recommended dense boundary mode.
    • Note: during the live test, the other projector still showed an older/color pattern in the network view. For final capture, blank the other projector or project unique marker grids on both projectors in a synchronized command.
  • Step 32 OAK-D PoE diagnostics were added after the user connected an OAK-D PoE at 192.168.1.100.
    • Python depthai is installed and verified as version 3.6.1.
    • Network check to 192.168.1.100:11490 succeeds.
    • Device reports as OAK-D-POE, mxid/device id 184430102127401300.
    • Connected cameras: CAM_A IMX378 color 4056x3040; CAM_B and CAM_C OV9282 mono/color 1280x800.
    • tools/oakd_poe_probe.py was added as a repeatable Python diagnostic until the C++ depthai-core dependency is selected.
    • Stable split commands:
      • 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
    • Outputs include OAK-D EEPROM calibration JSON, RGB/mono frames, rectified stereo frames, raw depth, depth preview, and JSON frame reports.
    • Current OAK-D view is not aimed at the projection screen: RGB/mono see the room/desk area, while depth works with about 33,078 valid depth pixels and mean depth about 3004 mm. Reposition OAK-D toward the curved screen before using it for marker/GrayCode calibration.
  • Step 33 OAK-D PoE recalibration research was documented. The current device EEPROM says boardName=DM2088, boardRev=R0M0E0, productName=OAK-D PoE AF, which maps to depthai-boards board config OAK-D-POE.json. Before mapping use, recalibrate with a flat ChArUco board via Luxonis manual calibration tooling, backup existing EEPROM first, and validate reprojection/depth before flashing.
  • OAK-D PoE monitor-based ChArUco capture was completed in out\oakd_recalibration_20260525_205548: 8 RGB, 8 left mono, 8 right mono frames. Processing produced good stereo metrics: left reprojection 0.2167 px, right reprojection 0.1968 px, left/right epipolar 0.1136 px. RGB reprojection was higher at 2.628 px; use this result as a good stereo-depth candidate, but consider a better second pass before relying on RGB-aligned depth or flashing EEPROM.
  • OAK-D manual ChArUco preview/capture tooling was added after Luxonis UI capture proved unreliable. Use tools\show_image_borderless.py for a borderless 1920x1080 target and tools\oakd_charuco_manual_capture.py for live RGB/left/right preview. The capture tool uses RGB isp full-FOV instead of cropped video.
    • Best current manual result: out\oakd_manual_preview_20260525_223541, 7 full RGB/left/right triplets.
    • Metrics: RGB reprojection 0.3542 px, left 0.4067 px, right 0.5296 px, left/right epipolar 0.3870 px, right/RGB epipolar 0.9393 px.
    • This improves RGB dramatically; stereo is acceptable but not as strong as the first monitor capture. Prefer one more 8-12 pose manual run before EEPROM flashing.
  • OAK-D second manual ChArUco pass was completed in out\oakd_manual_preview_20260525_230655 with 16 complete RGB/left/right triplets.
    • Metrics: RGB reprojection 0.5599 px, left 0.5681 px, right 0.4712 px, left/right epipolar 0.1917 px, right/RGB epipolar 1.2532 px.
    • This is the best balanced candidate so far because it has more pose diversity and improved stereo epipolar versus the seven-pose manual run, while keeping RGB reprojection far better than the original Luxonis monitor run.
    • OAK-D capture tools now leave RGB and mono exposure on auto by default. Manual exposure is only used when --rgb-exposure-us or --mono-exposure-us is explicitly set above zero.
  • OAK-D EEPROM was flashed with the 16-pose candidate.
    • Backup before flash: out\oakd_poe_before_eeprom_flash_20260525_230655\oakd_calibration_eeprom.json.
    • Flashed candidate/readback: out\oakd_manual_preview_20260525_230655\oakd_eeprom_candidate_flashed.json and oakd_eeprom_after_flash.json.
    • Device readback succeeded, EEPROM version is 7, and readback intrinsics match the 16-pose candidate.
    • Post-flash RGB/mono probe: out\oakd_poe_after_eeprom_flash_20260525_230655.
    • Post-flash depth probe: out\oakd_poe_after_eeprom_flash_depth_20260525_230655; depth pipeline starts, but the immediate probe had only 1471 valid pixels, so re-aim/recheck OAK-D before using its depth in mapping.
  • Hardware probe after adding two USB cameras and OAK-D was verified in out\hardware_probe_after_oakd.
    • Displays remain active as primary index 0, right projector index 1/DISPLAY2, left projector index 2/DISPLAY3.
    • USB camera4 and camera5 remain useful screen views.
    • New USB camera6 and camera7 are useful additional screen views.
    • camera8 and camera9 appear to be duplicate virtual/test streams and should not be used for calibration until proven otherwise.
    • Kinect color and the network camera are still captured by --probe-hardware.
  • Tight no-gap marker-grid defaults were updated but should still preserve the ArUco white quiet zone internally. Offline verification with 24x13 1.0 0.04 mono detected 312/312 generated markers.
  • Fast one-second GrayCode capture was added and verified.
    • Add optional frame_hold_ms to --capture-graycode-sequence-isolated and --capture-graycode-sequence-from-layout.
    • Use 1000 to hold each GrayCode frame for about one second.
    • Fast mode keeps USB cameras open and drains their frame buffers during the hold interval to avoid stale frames.
    • Verified outputs: out\fast_graycode_1s_test_left_freshusb and out\fast_graycode_1s_test_right_freshusb, all 44/44 frames for usb_4, usb_5, usb_6, usb_7, network, and kinect_color.
    • Current best USB decode coverage: left projector usb_6 then usb_5; right projector usb_7 then usb_4. Kinect color remains stable full-frame; network is useful overview QA.
  • Full fast calibration pass was run in out\calibration_20260526_0000.
    • Current layout: left projector CLI 1 / DISPLAY2, right projector CLI 2 / DISPLAY3.
    • Main GrayCode captures: graycode_left and graycode_right, all 44/44 for usb_4, usb_5, usb_6, usb_7, network, and kinect_color.
    • Separate OAK-D captures: graycode_left_oakd and graycode_right_oakd, all 44/44 for oakd_rgb, oakd_left, and oakd_right.
    • OAK-D decode worked after making parseGrayCodeSequenceInfo accept pretty-printed JSON display objects.
    • Fresh Kinect surface pipeline produced hybrid_surface_warp_left_full, hybrid_surface_warp_right_full, and surface_alpha_full.
    • Visual check capture: out\calibration_20260526_0000\surface_check_probe\surface_check_contact.png.
    • Current result is a usable full-frame surface-warp candidate, but local seam/geometry alignment still needs camera-observed marker-grid correction before final nDisplay export.
  • First camera-observed boundary/local correction test was run.
    • Marker-grid captures: out\calibration_20260526_0000\marker_grid_probe.
    • Marker detections were strong: network 480, Kinect 495, USB4 274, USB5 228, USB6 292, USB7 311.
    • Added tools\generate_camera_observed_check.py and tools\show_two_images_borderless.py.
    • Dense network-camera corrected projector images: out\calibration_20260526_0000\camera_observed_correction_network_dense.
    • Captured result: out\calibration_20260526_0000\camera_observed_correction_dense_probe\camera_observed_dense_contact.png.
    • This improves line alignment in the network-camera view, proving the correction path, but it is still a single-camera correction; multi-camera fusion is needed before treating it as final warp.
  • 4-second unified USB/OAK-D GrayCode capture was run in out\calibration_20260526_4s_oak_unified.
    • Added tools\capture_graycode_with_oakd.py.
    • Left and right passes captured 44/44 for usb_4, usb_5, usb_6, usb_7, oakd_rgb, oakd_left, and oakd_right.
    • Best decode sources remain left usb_6 and right usb_7; OAK-D mono streams decode, but OAK-D RGB was weaker on the left.
    • Generated a USB-driven correction with left usb_6 and right usb_7: out\calibration_20260526_4s_oak_unified\camera_observed_usb6_usb7_probe\camera_observed_usb6_usb7_contact.png.
    • OAK-D marker-grid boundary check found 0 markers on oakd_rgb, oakd_left, and oakd_right, so OAK-D should not yet drive boundary/local correction. It can participate in GrayCode/decode diagnostics.
  • Regularized multi-camera correction tooling was added.
    • New tool: tools\generate_regularized_multicamera_check.py.
    • It can use --reference-detected-csv to put multiple USB camera detections into one reference UV frame.
    • It now fits an affine baseline plus a clamped residual correction with outlier rejection and residual weighting to avoid local waves.
    • Bad reference-UV cubic result: out\calibration_20260526_4s_oak_unified\regularized_multicamera_reference_uv_probe\regularized_multicamera_reference_uv_contact.png.
    • Smoother diagnostic result: out\calibration_20260526_4s_oak_unified\regularized_multicamera_low_wave_probe\regularized_multicamera_low_wave_contact.png.
    • Ultra-smooth diagnostic result: out\calibration_20260526_4s_oak_unified\regularized_multicamera_ultra_smooth_probe\regularized_multicamera_ultra_smooth_contact.png.
    • Current conclusion: smoothing reduces waves, but the calibration is still not correct and projector overlap is not final. The next step must use one shared marker-ID/surface coordinate solve and explicit seam constraints, not just independent camera-to-reference homographies.
  • Marker-ID polynomial UV and marker-sampled projector fit were tested.
    • tools\generate_regularized_multicamera_check.py now supports --camera-uv-model poly and --sample-mode markers.
    • Dense polynomial marker-id UV output: out\calibration_20260526_4s_oak_unified\regularized_multicamera_marker_poly_probe\regularized_multicamera_marker_poly_contact.png.
    • Marker-sampled projector output: out\calibration_20260526_4s_oak_unified\regularized_multicamera_marker_sampled_probe\regularized_multicamera_marker_sampled_contact.png.
    • Marker UV RMS improved to about 0.014-0.018 UV, and dense inlier projector fit RMS improved to about 0.0158 UV left / 0.0099 UV right, but visual calibration is still not acceptable.
    • Conclusion remains: the next production solve must bind marker observations to the Kinect/OAK/depth-backed surface coordinate system and add explicit overlap seam constraints.
  • OAK-D PoE calibration camera mode changed to RGB 4K only.
    • tools\oakd_graycode_capture.py, tools\capture_graycode_with_oakd.py, and tools\oakd_live_preview.py now use only oakd_rgb_4k.
    • OAK mono streams oakd_left and oakd_right are removed from the main calibration capture path.
    • Default OAK RGB size is 3840x2160 via DepthAI API, default 5 fps.
    • Verified one-frame capture from 192.168.1.100: out\oakd_rgb_4k_probe\oakd_rgb_4k_isp.png, frame shape (2160, 3840, 3).
    • Use color.isp for the 4K stream; color.video produced a valid frame but logged a DepthAI crash dump on shutdown.
  • OAK is now temporarily excluded from active calibration.
    • tools\capture_graycode_with_oakd.py no longer opens OAK/DepthAI by default.
    • OAK can only be included with explicit --enable-oakd.
    • tools\oakd_graycode_capture.py no longer imports DepthAI unless OAK-specific code is used.
    • Active next calibration sources are USB cameras, network camera, and Kinect; OAK should not be used in layout verification, GrayCode capture, marker correction, or surface correction for now.
  • USB camera capture resolution was fixed.
    • Cause: UsbCamera previously opened DirectShow cameras without requesting a mode, so they defaulted to 640x480.
    • libs\camera\src\UsbCamera.cpp now tries MJPG modes in order: 1920x1080@30, 1280x720@30, 640x480@30.
    • Verification output: out\step_calibration_20260526\step02a_usb_resolution_probe\usb_resolution_contact.png.
    • Current confirmed USB modes:
      • camera4: 1920x1080
      • camera5: 1920x1080
      • camera6: 1280x720
      • camera7: 1280x720
    • The step 2 left GrayCode capture was recorded before this fix and should be redone before decoding or continuing the calibration.
  • USB camera aiming preview was added.
    • Script: tools\usb_quad_preview.py.
    • Launcher: tools\run_usb_quad_preview.ps1.
    • Desktop shortcut: C:\Users\post\Desktop\USB Cameras Preview.lnk.
    • Shows USB cameras 4,5,6,7 in one 2x2 live window and labels actual frame resolution.
    • Preview tiles use letterboxing so the full camera frame is visible without crop.
  • USB system-resolution diagnostics were added.
    • Script: tools\usb_resolution_probe.py.
    • Latest check: out\usb_resolution_probe_system_check\usb_resolution_probe.json.
    • Accepted DirectShow modes:
      • camera4: 1920x1080 via 1080p_mjpg
      • camera5: 1920x1080 via 1080p_mjpg
      • camera6: 1280x720 via 720p_mjpg
      • camera7: 1280x720 via 720p_mjpg
    • Windows does not provide a reliable global forced UVC resolution for all apps; mapping tools must request the preferred mode when opening cameras.
  • High-res step-by-step GrayCode decode is current.
    • Left capture: out\step_calibration_20260526\step02_graycode_left_highres.
    • Right capture: out\step_calibration_20260526\step03_graycode_right_highres.
    • Decode summary image: out\step_calibration_20260526\step04_decode_summary_contact.png.
    • Best current decode sources:
      • left: step04_decode_left_usb_5, step04_decode_left_network, step04_decode_left_kinect_color, with step04_decode_left_usb_6 as extra wide/overlap context.
      • right: step04_decode_right_usb_4, step04_decode_right_usb_7, step04_decode_right_network, step04_decode_right_kinect_color.
  • Denser high-res decode candidate was generated.
    • Parameters: sample_step=2, white=5, black=30, modulation=70.
    • Summary image: out\step_calibration_20260526\step04b_decode_s2_m70_summary_contact.png.
    • Valid points increased about 4x over the sample_step=4 decode while ratios stayed stable.
    • Candidate decode dirs use suffix _s2_m70, for example step04b_decode_left_usb_5_s2_m70 and step04b_decode_right_usb_7_s2_m70.
  • Locked-control GrayCode capture was added and tested.
    • UsbCamera can now read MAPPING_USB_CAMERA_PRESET and apply per-camera fixed autoExposure=false, exposure, gain, autoWhiteBalance=false, and whiteBalance values after opening the DirectShow camera.
    • New helper: tools\calibrate_usb_camera_controls.py sweeps USB exposure/gain/WB while projecting black/gray/white frames and writes a usb_camera_preset.json.
    • Conservative tested preset: out\step_calibration_20260526\step05_usb_camera_controls_conservative_preset.json.
    • CLI GrayCode capture now saves reference_black and reference_white frames before GrayCode frames for every active source: USB cameras, network camera, and Kinect color.
    • Kinect v2 color camera settings in the Microsoft Kinect SDK are read-only for this path (ExposureTime, Gain, Gamma), so manual fixed exposure/WB cannot currently be forced. The practical stabilization is keeping the Kinect color reader open during the sequence and recording black/white reference frames.
    • Network camera exposure/WB is not controlled through the snapshot URL yet; it is included in the same black/white reference frame capture and decode path.
  • Locked-control 4-second GrayCode retest was captured and decoded.
    • Left capture: out\step_calibration_20260526\step06_graycode_left_locked_controls.
    • Right capture: out\step_calibration_20260526\step07_graycode_right_locked_controls.
    • Decode settings: sample_step=2, white=5, black=30, modulation=70.
    • Summary image: out\step_calibration_20260526\step08_decode_locked_s2_m70_summary_contact.png.
    • Reference frame contact: out\step_calibration_20260526\step08_reference_frames_contact.png.
    • Decode summary JSON: out\step_calibration_20260526\step08_decode_locked_s2_m70_summary.json.
    • Left valid points:
      • usb_4: 93265/518400, ratio 0.1799, bounds (459,0)-(1919,1079).
      • usb_5: 95736/518400, ratio 0.1847, bounds (3,0)-(1919,1079).
      • usb_6: 23184/230400, ratio 0.1006, bounds (68,0)-(1919,1079).
      • usb_7: 33428/230400, ratio 0.1451, bounds (924,0)-(1919,1079).
      • kinect_color: 292690/518400, ratio 0.5646, bounds (0,0)-(1919,1079).
      • network: 91110/518400, ratio 0.1758, bounds (5,0)-(1919,1079).
    • Right valid points:
      • usb_4: 123614/518400, ratio 0.2385, bounds (0,0)-(1866,1079).
      • usb_5: 74989/518400, ratio 0.1447, bounds (0,0)-(829,1079).
      • usb_6: 15886/230400, ratio 0.0689, bounds (0,0)-(687,1079).
      • usb_7: 33057/230400, ratio 0.1435, bounds (0,0)-(1865,1079).
      • kinect_color: 279650/518400, ratio 0.5394, bounds (0,0)-(1919,1079).
      • network: 57354/518400, ratio 0.1106, bounds (0,0)-(1862,1079).
    • Interpretation: Kinect color became the strongest 2D decode source after the locked-control/reference-frame retest. USB/network are still useful for independent views and seam/edge validation, but the next geometry solve must treat Kinect color as a major observation source and bridge it to Kinect depth/surface.
  • Bright-room 2-second GrayCode retest was captured and decoded without Kinect saturation filtering.
    • USB bright-room preset: out\step_calibration_20260526\step09_usb_camera_controls_bright_room_preset.json.
    • Left capture: out\step_calibration_20260526\step10_graycode_left_bright_2s.
    • Right capture: out\step_calibration_20260526\step11_graycode_right_bright_2s.
    • Decode settings: sample_step=2, white=5, black=30, modulation=70.
    • Summary image: out\step_calibration_20260526\step12_decode_bright_2s_s2_m70_summary_contact.png.
    • Summary JSON: out\step_calibration_20260526\step12_decode_bright_2s_s2_m70_summary.json.
    • Left valid points:
      • usb_4: 87245/518400, ratio 0.1683.
      • usb_5: 71931/518400, ratio 0.1388.
      • usb_6: 51640/230400, ratio 0.2241.
      • usb_7: 58103/230400, ratio 0.2522.
      • kinect_color: 76218/518400, ratio 0.1470.
      • network: 99650/518400, ratio 0.1922.
    • Right valid points:
      • usb_4: 109439/518400, ratio 0.2111.
      • usb_5: 64171/518400, ratio 0.1238.
      • usb_6: 29709/230400, ratio 0.1289.
      • usb_7: 56080/230400, ratio 0.2434.
      • kinect_color: 75705/518400, ratio 0.1460.
      • network: 82298/518400, ratio 0.1588.
    • Interpretation: under room lights and 2-second frame hold, Kinect color no longer produces the very high raw valid count seen in the darker/4-second run. The stronger practical sources are now network, usb_4, and especially usb_6/usb_7 relative to their 720p sample counts.
  • Threshold sweep was run on the bright-room 2-second GrayCode captures.
    • Sweep outputs: out\step_calibration_20260526\step13_threshold_sweep_bright_2s and out\step_calibration_20260526\step13_threshold_sweep_bright_2s_extra.
    • Summary: out\step_calibration_20260526\step13_threshold_sweep_bright_2s_selected_summary.json.
    • Previous threshold white=5 black=30 modulation=70: 862189/5068800, ratio 17.01%.
    • Safe increased threshold white=10 black=30 modulation=40: 1141541/5068800, ratio 22.52%.
    • Balanced recommended threshold white=15 black=30 modulation=40: 1262403/5068800, ratio 24.91%.
    • Maximum-count threshold white=20 black=30 modulation=30: 1342832/5068800, ratio 26.49%.
    • black threshold had no meaningful effect in tested ranges 20..50; white and modulation drove the count changes.
    • Recommendation: use white=15 black=30 modulation=40 for the next production decode. Use white=20 black=30 modulation=30 only as an aggressive diagnostic because its component count is much higher and may admit noise.
  • Safe threshold sample_step=1 decode was tested on the bright-room 2-second GrayCode captures.
    • Settings: sample_step=1, white=10, black=30, modulation=40.
    • Summary image: out\step_calibration_20260526\step14_decode_bright_2s_s1_safe_summary_contact.png.
    • Summary JSON: out\step_calibration_20260526\step14_decode_bright_2s_s1_safe_summary.json.
    • Total: 4566442/20275200, ratio 22.52%.
    • Compared to sample_step=2 with the same safe thresholds (1141541/5068800, ratio 22.52%), the valid point count increases about 4x while the ratio stays effectively unchanged.
    • Interpretation: sample_step=1 is a denser version of the same mask and should be useful for final fitting if CSV size/performance is acceptable.
  • Kinect color decode was mapped to live Kinect 3D using the safe sample_step=1 bright-room decode.
    • Command inputs:
      • left decode: out\step_calibration_20260526\step14_decode_left_kinect_color_bright_2s_s1_safe.
      • right decode: out\step_calibration_20260526\step14_decode_right_kinect_color_bright_2s_s1_safe.
    • 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.
    • Settings: search_radius_px=4, max_depth_mm=4500.
    • Left result: 317464/327224 matched, ratio 0.9702, bounds X -0.069..2.172, Y -1.318..0.185, Z 2.729..3.906 meters.
    • Right result: 306031/306031 matched, ratio 1.0, bounds X -1.846..0.234, Y -1.361..0.185, Z 2.687..4.018 meters.
    • Interpretation: the 2D-to-3D bridge worked well for both projectors. The next step should filter these 3D projector samples against a screen-only Kinect segment before fitting the smooth surface.
  • Fresh Kinect point cloud, screen segment, and filtered projector 3D samples were generated.
    • Kinect point cloud: out\step_calibration_20260526\step16_kinect_point_cloud.
      • Points: 190155, colored: 175159, stride 1, max depth 4500 mm.
    • Screen segment: out\step_calibration_20260526\step17_kinect_screen_segment.
      • Bounds used: minX=-2.25 maxX=2.15 minY=-0.55 maxY=0.25 minZ=1.25 maxZ=3.45.
      • Screen points: 41467/190155, ratio 0.2181.
      • Screen bounds: X -2.136..1.960, Y -0.550..0.247, Z 2.573..3.449 meters.
    • Filtered left projector 3D: out\step_calibration_20260526\step18_filtered_projector_3d_left_kinect_s1_safe.
      • Threshold: 0.08 m.
      • Kept: 203109/317464, ratio 0.6398, mean nearest screen distance 0.00849 m.
      • Bounds: X -0.069..1.966, Y -0.628..0.185, Z 2.729..3.463 meters.
    • Filtered right projector 3D: out\step_calibration_20260526\step18_filtered_projector_3d_right_kinect_s1_safe.
      • Threshold: 0.08 m.
      • Kept: 187311/306031, ratio 0.6121, mean nearest screen distance 0.00784 m.
      • Bounds: X -1.835..0.221, Y -0.629..0.185, Z 2.687..3.462 meters.
    • Contact sheet: out\step_calibration_20260526\step18_kinect_screen_filter_contact.png.
    • Interpretation: filtering looks numerically healthy and preserved a very dense set of screen-near samples. Next step is fitting the smooth screen surface from filtered left/right samples plus the screen segment.
  • Smooth screen surface was fitted from filtered projector 3D samples plus the Kinect screen segment.
    • Output: out\step_calibration_20260526\step19_screen_surface_fit_s1_safe.
    • Contact sheet: out\step_calibration_20260526\step19_screen_surface_fit_s1_safe_contact.png.
    • Model: oriented_cylindrical_arc_pca_axis.
    • Input counts: left 203109, right 187311, screen 41467, total 431887.
    • Robust inliers: 431606.
    • Circle/cylinder: center (0.0395, -2.7403), radius 2.9791 m, branch sign 1.
    • 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: this is good enough to proceed to a prototype surface warp mesh, but not final precision. The 4-5 cm RMS suggests Kinect depth noise, segmentation thickness, screen cloth/edge clutter, and/or a too-simple cylindrical model still affect geometry. Expect visual check to require smoothing/regularization and possibly tighter screen segmentation.
  • Surface warp meshes, hybrid full-frame exports, and alpha blend masks were generated from the safe sample_step=1 dataset.
    • Left surface warp mesh: out\step_calibration_20260526\step20_surface_warp_left_s1_safe.
      • Grid 96 x 54, valid vertices 5184/5184, observed projector bounds (83,0)-(1919,686).
      • Mean nearest projector distance 1.73 px, max 47.04 px.
    • Right surface warp mesh: out\step_calibration_20260526\step20_surface_warp_right_s1_safe.
      • Grid 96 x 54, valid vertices 5184/5184, observed projector bounds (0,0)-(1919,703).
      • Mean nearest projector distance 6.01 px, max 138.85 px.
    • Left hybrid export: out\step_calibration_20260526\step21_hybrid_surface_warp_left_s1_safe.
      • Full frame 1920x1080, active pixels 1262019, active ratio 0.6086.
    • Right hybrid export: out\step_calibration_20260526\step21_hybrid_surface_warp_right_s1_safe.
      • Full frame 1920x1080, active pixels 1351680, active ratio 0.6519.
    • Alpha blend: out\step_calibration_20260526\step22_alpha_blend_s1_safe.
      • Gamma 2.2, overlap theta (1.52111, 1.61416).
      • Nonzero blend pixels: left 1253092, right 1348764.
    • Contact sheet: out\step_calibration_20260526\step22_surface_warp_hybrid_blend_contact.png.
    • Next step: project --project-hybrid-surface-check 1 2 ... or equivalent using current left/right display indices, then capture/check visually before treating this as useful warp.
  • Hybrid surface check was projected and captured with cameras.
    • Projection command used left display index 1, right display index 2, left/right hybrid dirs from step21, and alpha blend dir from step22.
    • 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 sources: usb_4, usb_5, usb_6, usb_7, network, kinect_color.
    • Visual observation: the pattern is readable and the surface-space grid is projected, but the lower part of the physical screen remains blank because the hybrid exports are in observed mode with trusted projector Y bounds only to about 686 left and 703 right. This is expected from the current full-frame-container + observed-region-truth policy, not a capture failure.
    • Next options: either continue evaluating observed-region warp quality, or generate a diagnostic full hybrid export/extrapolated check if the user wants to fill the whole projector frame visually.
  • Diagnostic full/no-mask hybrid surface check was generated and captured.
    • Full exports:
      • left: out\step_calibration_20260526\step24_hybrid_surface_warp_left_s1_safe_full.
      • right: out\step_calibration_20260526\step24_hybrid_surface_warp_right_s1_safe_full.
      • Both are 1920x1080, activeRatio=1.0, mode full.
    • Projection capture: 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.
    • Observation: the lower screen area is now filled, confirming that the previous blank lower area was caused by observed-region masking/trust bounds. However, the full extrapolated area shows clear artifacts/rectangular patches in the lower region, so it is diagnostic only and should not be treated as a reliable final warp.
  • Root cause of the missing lower screen area was found and corrected in a new diagnostic path.
    • The kinect_color decode and 2D-to-3D bridge already had full projector Y coverage (0..1079).
    • The old screen segment used minY=-0.55 m, while lower projector pixels map to Kinect camera-space Y down to about -1.25 m left and -1.16 m right.
    • Therefore --filter-projector-3d-by-screen-segment removed all lower projector samples, shrinking observed projector bounds to about Y <= 686..703.
    • New screen segment: out\step_calibration_20260526\step26b_kinect_screen_segment_tall_zscreen.
      • Bounds used: X -2.25..2.15, Y -1.35..0.25, Z 2.50..3.65.
      • Screen points: 75132/190155, ratio 0.3951.
    • New filtered projector samples:
      • left: out\step_calibration_20260526\step27b_filtered_projector_3d_left_kinect_tall_zscreen_s1_safe, kept 316788/317464, ratio 0.9979.
      • right: out\step_calibration_20260526\step27b_filtered_projector_3d_right_kinect_tall_zscreen_s1_safe, kept 305883/306031, ratio 0.9995.
    • New surface fit: out\step_calibration_20260526\step28_screen_surface_fit_tall_zscreen_s1_safe.
      • Residual RMS: all 0.0301 m, left 0.0230 m, right 0.0191 m, screen 0.0686 m.
    • New surface meshes:
      • left: out\step_calibration_20260526\step29_surface_warp_left_tall_zscreen_s1_safe, mean nearest projector distance 3.29 px.
      • right: out\step_calibration_20260526\step29_surface_warp_right_tall_zscreen_s1_safe, mean nearest projector distance 2.80 px.
    • New hybrid observed exports:
      • left: out\step_calibration_20260526\step30_hybrid_surface_warp_left_tall_zscreen_s1_safe, active ratio 0.9911, observed bounds (17,0)-(1919,1079).
      • right: out\step_calibration_20260526\step30_hybrid_surface_warp_right_tall_zscreen_s1_safe, active ratio 1.0, observed bounds (0,0)-(1919,1079).
    • New alpha blend: out\step_calibration_20260526\step31_alpha_blend_tall_zscreen_s1_safe.
    • New projection capture: out\step_calibration_20260526\step32_hybrid_surface_check_tall_zscreen_projection\step32_hybrid_surface_check_tall_zscreen_contact.png.
    • Observation: the lower screen is now filled in observed/masked mode, confirming the fix. The check still needs geometric/seam quality evaluation before continuing to final warp/blend.
  • Boundary-aware surface check pattern diagnostic was added.
    • Code change: --project-hybrid-surface-check now computes local top/bottom axis curves from active PFM samples across surface theta bins and normalizes vertical v between those curves for the check pattern.
    • This affects the visual diagnostic grid only; it does not yet change the exported warp mesh geometry.
    • Captured output: out\step_calibration_20260526\step34_boundary_aware_surface_check_projection\step34_boundary_aware_surface_check_contact.png.
    • Live projection output: out\step_calibration_20260526\step35_live_boundary_aware_surface_check.
    • Observation: the diagnostic helps separate vertical-coordinate parameterization from projector warp, but camera captures suggest it is not a complete fix for horizontal-line alignment. A stronger next step is to detect/fit actual screen top/bottom edges from camera/marker observations and use those boundary curves in the surface UV solver, not only in the check pattern.
  • Boundary-aware diagnostic was rejected by the user and reverted.
    • User observation: it became worse, top projection no longer covered the full area and horizontal lines were still not parallel to screen borders.
    • Mapping repo revert commit: dcd8a6c.
    • Current live projection output after revert: out\step_calibration_20260526\step36_live_reverted_surface_check.
    • Current interpretation: do not use the PFM-derived boundary-aware check as the path forward. The next investigation should focus on real screen edge detection / marker-grid boundary constraints and on the surface/UV solve itself.
  • Upright Kinect-Y surface frame diagnostic was added and tested.
    • Code change: --build-surface-warp-mesh accepts optional final mode argument upright after full-frame width/height. In this mode the same XZ cylinder is used, but surface vertical coordinate is Kinect/world Y, not the fitted PCA screen axis.
    • Mapping commit for the mode: pending/current local branch at the time of this note.
    • Outputs:
      • left mesh: out\step_calibration_20260526\step37_surface_warp_left_upright_s1_safe.
      • right mesh: out\step_calibration_20260526\step37_surface_warp_right_upright_s1_safe.
      • left hybrid: out\step_calibration_20260526\step38_hybrid_surface_warp_left_upright_s1_safe.
      • right hybrid: out\step_calibration_20260526\step38_hybrid_surface_warp_right_upright_s1_safe.
      • alpha blend: out\step_calibration_20260526\step39_alpha_blend_upright_s1_safe.
      • captured check: out\step_calibration_20260526\step40_upright_surface_check_projection\step40_upright_surface_check_contact.png.
      • live projection: out\step_calibration_20260526\step41_live_upright_surface_check.
    • Results: left mesh mean nearest projector distance 4.03 px, right 2.80 px, both full 1920x1080 observed exports.
    • Observation: captured views look very similar to the reverted/oriented variant; no strong improvement in horizontal-line alignment. Therefore the tilted PCA axis is not the only/main cause. The next useful fix should add real screen edge/marker boundary constraints to the surface/projector solve.
  • Upright Kinect-Y diagnostic was rejected by the user and reverted.
    • User observation: upright variant became worse.
    • Mapping repo revert commit: 4407c57.
    • Current live projection after revert: out\step_calibration_20260526\step42_live_reverted_after_upright_check.
    • Current stable diagnostic output remains the tall-zscreen oriented variant:
      • 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.
    • Interpretation: both quick vertical-coordinate experiments failed. Do not continue with surface-frame hacks. Next direction should be observation-driven boundary/edge constraints from cameras or marker grids.
  • Raw marker-grid boundary observation test was started.
    • Dense 24 x 14 grid was too dense for reliable detection after projection/camera capture:
      • capture: out\step_calibration_20260526\step44_marker_grid_boundary_capture.
      • most cameras detected 0..1 markers only.
    • Coarser 12 x 7 grid worked:
      • left generated grid: out\step_calibration_20260526\step45_marker_grid_left_raw_12x7, IDs 84..167.
      • right generated grid: out\step_calibration_20260526\step45_marker_grid_right_raw_12x7, IDs 168..251.
      • 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.
    • Top/bottom row observations are usable, especially from network and kinect_color. Extreme side columns are weak or absent, so the first boundary-constraint implementation should focus on top/bottom curves before left/right side constraints.
  • Marker grid detections were converted into projector/camera observation files.
    • Output: out\step_calibration_20260526\step48_marker_boundary_observations_12x7.
    • Report: marker_boundary_observations_report.json.
    • Joined observations: marker_projector_camera_observations.csv.
    • Boundary row candidates: boundary_row_candidates.csv.
    • Projector-space consensus points: boundary_consensus_projector_points.csv.
    • Contact sheet: marker_boundary_observation_contact.png.
    • Total joined observations: 542.
    • Interpretation: this provides a useful link between marker IDs, projector cell positions, and camera detections. However, it is still marker-center/row visibility data, not direct physical screen edge detection. For robust top/bottom edge constraints, the next capture should use a dedicated border/edge pattern or marker grid with explicit edge lines so cameras can estimate the actual screen boundary, not just which marker rows are readable.
  • A marker grid with explicit colored border lines was tested.
    • Pattern output: 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 is visually useful, but it reduces marker detection versus the plain 12 x 7 grid, especially on top/bottom rows and extreme columns. Use two separate observations for the boundary solve:
      • plain marker grid for marker ID to projector/camera correspondences;
      • clean border-only or edge-line pattern for physical screen top/bottom/side extraction.
  • A clean border-only diagnostic frame was tested after the marker+border frame.
    • Pattern output: 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 resolutions:
      • usb_4, usb_5, network, kinect_color: 1920x1080.
      • usb_6, usb_7: 1280x720.
    • Operational note: --probe-hardware hung after USB captures during this step, likely while entering Kinect/network capture; the successful capture was done with explicit per-camera commands.
    • Interpretation: the clean frame is better for human inspection and line extraction than the marker+border frame. The first automatic edge extraction attempt used a global brightness/saturation mask and was too coarse because background walls/metal also enter the mask. The next implementation should segment known projected colors/guide lines within a screen ROI or use marker observations to crop the camera image before fitting top/bottom physical boundary curves.
  • ROI-constrained border-line extraction was tested.
    • 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: use marker detections from step46_marker_grid_boundary_capture_12x7 to crop each camera image, then run color/brightness line detection on the clean border-only capture from step52_clean_border_capture_manual.
    • Result: ROI cropping removes most background false positives. network and kinect_color provide the strongest full-screen line observations; USB cameras are useful as local checks but have narrower/partial views.
    • Interpretation: this validates the two-frame approach. The next correction should use marker-grid detections to define camera ROIs, extract top/bottom guide curves from clean border captures, compare those curves to the physical screen border in the same ROI, and then generate a smooth boundary correction for the warp.
  • A first boundary-normalized check projection was generated and tested.
    • Pattern output: 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 display output: out\step_calibration_20260526\step56_live_boundary_normalized_check.
    • Method: use network and kinect_color marker ROIs plus top/bottom line fits from step53 to build a projector check image with camera-space vertical normalization between fitted boundary curves. The generated images are diagnostic only; they do not replace the current stable PFM/hybrid warp.
    • Result: captured images do not show a clear improvement. The pattern is usable for visual comparison, but the seam and line alignment still look problematic, so this first boundary-normalized fit should not be promoted to the final warp.
    • Interpretation: the boundary solver needs a better target: fit real physical top/bottom screen edges separately from projected guide lines, then solve a smooth correction constrained by marker correspondences and overlap continuity.
  • The boundary-normalized diagnostic was rejected and the live display was returned to the stable tall-zscreen surface check.
    • Stopped experimental live projection: out\step_calibration_20260526\step56_live_boundary_normalized_check.
    • Restarted stable projection: out\step_calibration_20260526\step57_live_reverted_to_stable_tall_zscreen.
    • Stable inputs remain:
      • 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.
    • No code or PFM files were changed by the boundary-normalized diagnostic; it was only an alternative check-image projection.
    • Current conclusion: do not continue with heuristic check-image normalizations. The next useful work is analysis/design around a real screen model and independent boundary/surface constraints.
  • A fresh step-by-step recalibration was restarted at the user's request.
    • Root: out\recalibration_20260526_step_by_step.
    • Step 00 hardware state: step00_hardware_state.
      • Displays: DISPLAY1 index 0 primary, DISPLAY2 index 1, DISPLAY3 index 2.
      • Cameras captured: usb_4/usb_5 at 1920x1080, usb_6/usb_7 at 1280x720, network at 1920x1080, kinect_color at 1920x1080.
    • Step 01 projector layout: step01_projector_layout.
      • DISPLAY2 / CLI index 1 / marker 10: left projector.
      • DISPLAY3 / CLI index 2 / marker 11: right projector.
    • Step 02 GrayCode capture:
      • left: step02_graycode_left, all active cameras captured 44/44.
      • right: step02_graycode_right, all active cameras captured 44/44.
    • Step 03 GrayCode decode with sample_step=1, white=5, black=30, modulation=70.
      • Summary: out\recalibration_20260526_step_by_step\step03_decode_summary.json.
      • Contact: out\recalibration_20260526_step_by_step\step03_decode_contact.png.
      • Left valid pixels: network 402012, kinect_color 313356, usb_4 322192, usb_5 261609, usb_6 126259, usb_7 136002.
      • Right valid pixels: network 382138, kinect_color 370118, usb_4 456496, usb_5 271155, usb_6 67782, usb_7 266384.
      • Current camera recommendation for the next step: use network as overview QA, kinect_color for the 2D-to-3D bridge, and local USB views usb_4/usb_5 on the left and usb_4/usb_7 on the right. Treat right usb_6 as weak/non-primary.

Next Actions

  • Run --verify-projector-layout after Windows reboot, projector reconnect, cable changes, or GPU driver changes before GrayCode capture, then use --capture-graycode-sequence-from-layout instead of hard-coded projector indices.
  • Continue from the PFM lookup prototype toward a real screen-geometry warp: integrate Kinect/depth or fitted screen surface, verify Unreal nDisplay PFM coordinate convention, and then export final warp geometry.
  • Prioritize warp correctness before further blend work: refine projector-to-surface mapping so horizontal check lines follow the physical screen bend and overlap features align in camera views.
  • Replace independent camera-observed local correction with a shared marker-ID/surface solve: match detected marker ids to marker_grid_manifest.csv, attach USB/network/Kinect/OAK observations to one screen coordinate system, and explicitly constrain the projector overlap seam before fitting the warp field.
  • Keep OAK completely out of the active calibration path until the user explicitly asks to re-enable it.
  • Continue blend work only after geometry is acceptable: seam-local geometry correction, coverage-aware refinement, and later brightness/black-level compensation.
  • Verify Unreal nDisplay PFM semantics against documentation or an Unreal test project. If nDisplay expects a different coordinate basis or normalized warp fields, add an explicit converter from the current metric x_m,y_m,z_m PFM.
  • Treat network as a normal additional calibration camera whenever local .env.local or MAPPING_NETWORK_CAMERA_URL is available; decode it with camera name network.
  • Keep projector order as currently observed unless the user physically reports otherwise:
    • Windows monitor 2 / DISPLAY2 / CLI index 1: left projector.
    • Windows monitor 3 / DISPLAY3 / CLI index 2: right projector.
  • Run calibrator_cli --probe-hardware out\hardware_probe 10 env:MAPPING_NETWORK_CAMERA_URL when hardware is rechecked.
  • Continue from sequence capture toward GrayCode decode, correspondence filtering, and projector-as-inverse-camera calibration.
  • Study the first-priority references before implementing projector-camera decoding and calibration details.

Blockers

  • Public repository name and remote are not selected.
  • Dependency management approach is not finalized; vcpkg.json and CMakePresets.json are the first practical path.
  • Exact Unreal nDisplay PFM convention needs verification before final exporter behavior.