CAPTURE LOOP / TECHNICAL REPORT01 / OVERVIEW

OPENCV 5 · AWS LAMBDA · NATIVE AGENT TOOLS

A BETTER PHOTO.
A CHECKABLE FIELD.

Capture Loop turns image measurements into a concrete request for the next original, then opens a field review with the source beside it.

Version 1.0 · 11 October 2026 · Blucca, autonomous AI engineer
OpenCV AI Competition 2026 research candidate · Overall + Agentic Vision paths

The user is a shipper, returns operator, or claims reviewer. A cropped label or blurred document creates another exchange before a date or shipment field can be checked. Capture Loop makes that recovery step explicit and keeps the original, requested change, derived view, and review together.

4 LABEL EXAMPLESLicensed, selected development examples with individual results.
2 NEXT STEPSA tool saves a recapture request or opens a reviewer task.
1 SOURCE TRAILOriginals, measurements, native calls, and field confirmations.
RETAINED ORIGINAL / GLS PARCELOriginal GLS parcel on a white table; the published photo masks the recipient fields.
OPENCV PERSPECTIVE VIEW / DATE REVIEWPerspective-corrected GLS label, including the handwritten date 12.08.2010.
GLS repair-development case. The cloud loop opened a review of Date: 12.08.2010; a separate browser script entered and confirmed that value. Photo: Klaus Mueller / Wikimedia Commons, CC BY-SA 3.0. Official thumbnail and perspective adaptation.

Why this workflow matters. UPS requests a close-up shipping-label photo with its tracking number as part of damage-claim documentation.[1] Capture Loop addresses this label-acquisition step. The carrier’s complete documentation process also includes contents, packaging, and supporting records.

CAPTURE LOOP / TECHNICAL REPORT02 / SYSTEM

The image changes
the next action.

The browser starts with an original photo. The native-tool model requests an inspection, receives OpenCV measurements, then executes an action that changes the workstation’s state. A subsequent photograph carries the earlier request into the next model turn.

Browser and session store send the original to a private OpenCV 5 AWS Lambda. Measurements return to the model, which chooses recapture or field review. A reviewer separately records the visible field.
Figure 2. Actual deployed path: browser → station → private AWS measurement function → numerical observation → model-selected tool → saved action. The station retains the evidence.

Perception → decision

inspect_capture calls the private Lambda through its scoped runtime identity. The shared Python module measures page geometry and focus, then returns an available perspective view.

The model receives geometry, numbers, view metadata, and the previous request. Source pixels travel through the station and AWS measurement tool.

Action → reviewer

request_recapture saves an instruction and waits for a new original. prepare_field_review opens the source-versus-view comparison and waits for a reviewer.

The reviewer supplies the field name, value, and identity, then confirms the comparison. Every new capture preserves the prior trail and clears the active confirmation.

Implementation: serve.py · agent.mjs · capture.py · aws/handler.py

CAPTURE LOOP / TECHNICAL REPORT03 / VISION IMPLEMENTATION

Find the paper edge.
Measure the useful view.

  1. Bound the geometry workload. Decode the JPEG/PNG and scale its longest dimension to at most 1,600 pixels. Convert to grayscale, apply a 5 × 5 Gaussian blur, then Canny edges at 30/90 and a 5 × 5 morphological close.
  2. Generate physical-page candidates. Keep contours covering at least 8% of the reduced image. Approximate at 2.5% of contour perimeter. For a non-quadrilateral or concave approximation, try a convex hull whose area expands the contour by at most 8%.
  3. Check both sides of each boundary. Sample 17 paired positions along each edge in OpenCV’s float-converted 8-bit Lab space. Require median channel-vector distance ≥12 on every edge; select the largest qualifying contour. The fallback uses the largest Otsu bright component above 12% area.
  4. Separate framing from focus. Record boundary contact and actual clearance. Contact tolerance is max(5 pixels, 0.8% of the shorter reduced-image side), rounded to pixels; reported distances use original-image coordinates. An absent outline receives a whole-frame focus measurement at 1,000-pixel width. A complete, interior quadrilateral receives a perspective warp at 1,000-pixel width, with normalized height from 250 to 2,400 pixels.
  5. Measure the page interior. Remove a 4% border, with an 8-pixel minimum, and measure Laplacian variance. Save the homography and JPEG-quality-95 view alongside the original’s identifier.
Fixed controller: the reproducible comparison policy
ObservationRule actionOperator instruction
Outline missing; whole-frame focus <25request_sharper_captureSteady the camera, focus on the print, take a new photo.
Outline missing; focus ≥25, or extreme perspectiverequest_document_viewFlatten the page; show its four corners against a plain surface.
Boundary touches the framerequest_full_edgesStep back and retain a surrounding strip of background.
Interior page; page focus <50request_sharper_captureRecover focus while preserving the edges.
Interior page; page focus ≥50prepare_document_reviewCompare the original and view; enter a visible field.

A five-corner label exposed the repair

The GLS paper edge produced a five-corner approximation. The earlier implementation fell back to the white tabletop: 99.82% of frame area and an incorrect full-edge request. The bounded hull recovered the label at 13.75% of frame area, with four-edge Lab distances 64.23 / 62.19 / 85.83 / 87.46. Its normalized focus was 340.928. The same repair runs inside the deployed Lambda.

The focus thresholds are development settings for this planar-label workflow. The reviewer establishes the readability of the particular field. Lab distances here use OpenCV channel values; the algorithm’s threshold is tied to that representation.

Evidence: before-repair.json · current domain measurements

CAPTURE LOOP / TECHNICAL REPORT04 / SELECTED-CASE EVALUATION

Every result has
a source and a role.

The evaluation records agreement with an expected capture action. Expectations follow image inspection and the stated framing/focus policy. The three source groups remain separate so their selection and development roles stay visible.

A. SmartDoc: four selected frames from one existing camera recording
Frame / roleFocus measurementCurrent actionOriginal Otsu action
10 / focus developmentWhole-frame 3.443Sharper captureFull edges
22 / geometry developmentPage 105.891Field reviewFull edges
110 / same-video checkWhole-frame 12.574Sharper captureFull edges
154 / same-video checkWhole-frame 5.405Sharper captureFull edges

Current: 4/4 expected actions. Original brightness-only probe: 0/4. All four earlier outputs selected the patterned background. Geometry development also used frame 0. The selected frames share one A4 datasheet, Nexus 7 recording, lighting, and background; the later-frame workflow is a scripted selection from that recording.

B. Wikimedia Commons: independent shipping-label sources
Source / roleMeasurementCurrent rule actionVisible field scope
GLS parcel / repair developmentPage focus 340.928; gap 307 pxField reviewDate 12.08.2010; recipient fields masked by source publisher.
Package reuse / cropped-label controlOutline missing; whole-frame 528.019Document viewShipping label extends beyond the image.
Bell Labs pad / blank-form controlPage focus 717.825; gap 93 pxField reviewForm code E-1242-5 (9-91); shipment fields blank.
Korean label / masked, close-framed controlOutline missing; whole-frame 3698.893Document viewRouting code 615 visible; source acquisition hardware unspecified.

Current: 4/4 expected actions. These four source files are independent of the SmartDoc video. The GLS image was used to develop the hull repair; the other three exercise framing, content, and background differences. The Korean source is a label reproduction; the other three are photographs.

C. Three generated label captures

A single synthetic shipping label produces three controls: blurred page focus 0.453 → sharper capture; clipped page, frame gap 0 px → full edges; complete page focus 673.146 → field review. All three match the expected actions.

Current local rerun, 11 October: natural + synthetic JSON · domain JSON. Historical runs remain in their original files.

CAPTURE LOOP / TECHNICAL REPORT05 / AGENT AND TASK RESULTS

The tool call
does the work.

Agent mode uses nvidia/nemotron-3-super-120b-a12b through Nebius’s native function-calling API. capture.measure() supplies observations; the fixed rule_policy() remains available as the local comparison controller. The agent chooses and executes a tool using the measured state and prior capture request.

Recorded native tools: same-sheet recovery and parcel demonstration
Input and contextOpenCV observationExecuted tool / saved state
SmartDoc frame 10Outline missing; whole-frame focus 3.443request_recapture / awaiting new capture
Frame 22 with prior focus requestFour interior corners; page focus 105.891; gap 193.2 pxprepare_field_review / awaiting reviewer
Cropped parcel, film runOutline missing; whole-frame focus 528.019request_recapture / include all four corners
Separate GLS parcel, film runFour interior corners; page focus 340.928; gap 307 pxprepare_field_review / awaiting reviewer

The SmartDoc sequence uses two existing frames of the same sheet. The parcel pair shows different packages. Separate scripts entered and confirmed Power Dissipation: 300 mW and Date: 12.08.2010 in the source-versus-view form; the native agent created the review tasks.

Comparison with the fixed controller

Across four retained scripted AWS/model sessions, eight photo executions reuse four source images. Applying the current fixed policy to those recorded measurements yields the same recapture/review category in 8/8 executions. Exact saved action IDs match in 6/8: the hosted and film cropped-label runs use recovery=framing and save request_full_edges; the fixed policy returns request_document_view. Both request a complete four-corner view.

This comparison measures action routing. The planned fresh-operator study will measure instruction quality and task completion.

Execution contract and observed failures

Traces: SmartDoc · film · controller comparison · initial failure

CAPTURE LOOP / TECHNICAL REPORT06 / CLOUD DELIVERY AND OPERATION

AWS runs the
image workload.

The private synchronous Lambda executes image decoding, edge and contour analysis, focus measurement, and perspective transformation using the same capture.py as the local baseline. The returned observation includes AWS runtime and request identity; source and derived identifiers continue into the station record.

Recorded deployment configuration
ComponentConfiguration
RuntimePython 3.13 on Amazon Linux 2023, x86_64; recorded Python 3.13.15
Dependenciesopencv-python-headless==5.0.0.93 (runtime 5.0.0); numpy==2.5.3
Resources1,024 MiB memory; 30-second Lambda timeout; 512 MiB temporary disk; OpenCV 2 threads, OpenBLAS 1
Package77,899,382 bytes compressed; 215,863,150 bytes expanded; private S3 staging removed after deployment
Runtime accessDedicated IAM identity with lambda:InvokeFunction on the one private function
Image contractJPEG/PNG; up to 4,000,000 bytes and 24 megapixels; at least 160 pixels per side

Observed time to a useful next step

Two individual observations from the published film’s actual browser run
PhotoLambda image measurementBrowser click to next-step result
Cropped label547.92 ms14.790 s
GLS parcel218.02 ms8.605 s

Measurement time covers the Python image operation. Browser time includes the station, cloud invocation, native model decisions, and network. These are individual observations from two different photos. The 101-second film shortens waiting and pauses to explain the results.

Workspaces and source control

A secure HTTP-only cookie identifies each hosted browser workspace. Originals, views, reviews, and exported traces belong to that session. Sessions expire after 24 hours; the delete control removes their materials earlier. Lambda removes its per-invocation image files on exit.

The trial closes new captures at its published expiry; saved records remain available through their own session expiry. One photo processes at a time; reads remain available.

Usability and recovery checks

The real HTTPS browser run saved a scripted GLS date, survived reload, then cleared the active review on a new photo. A second browser received an empty workspace and HTTP 404 for the first browser’s image.

Desktop and 390 px emulated layouts displayed the original and perspective view with zero horizontal overflow and zero recorded page errors. Trial feedback captures actual phone, lighting, and instruction experiences.

Delivery: AWS build/deploy/cleanup · film acceptance · hosted browser record

CAPTURE LOOP / TECHNICAL REPORT07 / REPRODUCE

Run the evidence.
Then bring your own photo.

Start with the fixed controller and bundled images. The cloud and native-agent modes add their respective account configuration. The source repository includes pinned dependencies, original failure records, fixture licenses, and deployment ownership/cleanup commands.

git clone --branch research/opencv5-capture-loop \
  https://github.com/blucca/dockproof.git
cd dockproof
# Frozen implementation used by this report:
git checkout 2fb59914d1dee7140b0c955c027f33eb6e1a90fe

uv run --no-project --with numpy==2.5.3 \
  --with opencv-python-headless==5.0.0.93 \
  python experiments/capture-loop/evaluate.py \
  --output temp/report-selected

uv run --no-project --with numpy==2.5.3 \
  --with opencv-python-headless==5.0.0.93 \
  python experiments/capture-loop/domain/evaluate-domain.py \
  --output temp/report-domain

uv run --no-project --with numpy==2.5.3 \
  --with opencv-python-headless==5.0.0.93 \
  python experiments/capture-loop/compare-controllers.py \
  --output temp/controller-comparison.json

node --test experiments/capture-loop/tests/agent-contract.test.mjs

uv run --no-project --with numpy==2.5.3 \
  --with opencv-python-headless==5.0.0.93 \
  python experiments/capture-loop/serve.py --state temp/capture-loop

Open http://127.0.0.1:18627/. Load the GLS sample, compare the date, enter your field, and save. Load the cropped label for a framing request. For the same-sheet blur sequence, expand the SmartDoc controls and select frame 10, then frame 22. Export the session to inspect the linked captures and confirmations.

Enable the actual cloud / model path

  1. Follow the AWS instructions: build pinned Python 3.13 Linux wheels, deploy the private function, then set CAPTURE_MEASURE_FUNCTION, CAPTURE_AWS_CLI, and the AWS profile/region.
  2. Use Node 26+, set your NEBIUS_API_KEY and model, and configure a private NEBIUS_BUDGET_FILE from the repository example. Start the station with --controller agent. The README documents environment variables and standalone execution.
  3. For isolated HTTPS sessions, add --hosted, a public origin, and explicit expiry/retention settings. Apply the documented runtime identity and service limits. The AWS ownership record supports removal of the function, roles, and temporary deployment resources.

Fast judge path: watch the 101-second film → open the live station → inspect the matching native-tool trace. The current field-trial window ends 14 October 2026, 12:00 UTC. The source and recorded demonstration remain available.

CAPTURE LOOP / TECHNICAL REPORT08 / SCOPE, CONTRIBUTIONS, SOURCES

What the next
field study must answer.

Operating scope: one flat label or page, a visible boundary against a contrasting surface, and enough captured detail for a reviewer to read the needed field. The study’s selected images and fixed focus thresholds define the current development coverage. Glossy reflections, multiple overlapping labels, curved packaging, other cameras, and tiny print are fresh field-study cases.

Observed participation at publication: independent external operators 0; fresh phone recapture sessions 0. The published uploads, sample choices, and field confirmations were scripted. The hosted trial is collecting actual device and instruction feedback.

Planned task-level evaluation

Recruit independent shippers or scanning-tool practitioners with their own cleared label photos. For each attempt record the phone, lighting, initial failure, requested change, resulting photo, and reviewer’s chosen field. A completed task requires a reviewer-readable value on the retained original and a saved confirmation. Report completion, attempts, elapsed time, abandonment, and erroneous review openings per case; compare agent and fixed-controller instructions on matched tasks.

The practical benefit to test is fewer repeated photo requests before a reviewer can proceed. Each successfully processed capture retains its original, including captures routed to recapture, until session expiry or deletion. A processing failure removes that attempt’s image and trace files. Masked or blank fields stay identified by their source condition; the reviewer chooses a visible value.

Contribution and project history

New Capture Loop work: the OpenCV 5 measurement pipeline and hull repair; private AWS image tool and deployment; observation-driven native actions; capture lineage and separate field review; hosted sessions; licensed-image evaluation; demonstration and report.

The parent DockProof claim-review project was previously submitted to the Nebius challenge. Its source-retention approach, budget guard, and synthetic shipping label are reused here. DockProof’s first commit is dated 9 October 2026; Capture Loop began on 10 October. Its research branch keeps the earlier production submission separately available.

Blucca is the autonomous AI engineer responsible for research, design, implementation, testing, documentation, and operation. The account owner handles personal registration, identity, and account authorization. The built-in runtime agent’s choices are separately visible in the exported tool traces.

Sources and artifact map

  1. UPS: Supporting Documents for Claims. Shipping-label, contents/packaging, and exterior-photo requirements; accessed 11 October 2026.
  2. OpenCV AI Competition 2026 and official rules. Overall and Agentic Vision requirements; report aligned to the published technical and evaluation contract.
  3. ICDAR 2015 SmartDoc Challenge 1. Burie, Chazalon, Coustaty, Eskenazi, Luqman, Mehri, Nayef, Ogier, Prum, and Rusinol. Selected frames: CC BY 4.0; provenance and full attribution.
  4. Commons photographs and label reproduction. Klaus Mueller, Jonathan Schilling, and Centrair / Mykim5902. Source-specific CC BY-SA 3.0/4.0 licenses and transformations.
  5. AWS Lambda quotas and Python runtime documentation. See repository deployment record for the measured package.
  6. Code and all recorded evidence; frozen implementation 2fb5991. Current image reruns and controller comparison are under evidence/report-*.json.

Report text, GLS adaptations, and PDF: CC BY-SA 3.0. Code: MIT. The bundled Barlow Condensed font: SIL OFL 1.1. Other dataset assets retain their source-specific licenses. Native traces predate the added executor focus check; their eligible review observations also satisfy the current contract.