vision-perception: Sub-Pixel Curvilinear Perception & Autonomous Disaster Response

Powered by OpenCV 5, AWS Bedrock Agents, and COOL on Graviton3

Inspiration

On 26 August 2026, a catastrophic glacier collapse in the Langtang Himal range triggered an extreme high-velocity debris flood down the steep gorge of the Lende Khola and Bhote Koshi rivers in Nepal. In active alpine terrain, conventional flood disaster mapping relies on simple pixel-difference thresholds. These fail catastrophically in mountain valleys due to monsoon cloud cover, severe terrain shadow casting, and turbid glacial flour altering spectral reflectivity.

We engineered vision-perception to solve this crisis by uniting mathematically rigorous sub-pixel curvilinear computer vision with an autonomous, evidence-gated cloud decision loop that operates without human latency.


What It Does

Our system bridges heavy computer vision with modern autonomous AI through four core pillars:

  1. Sub-Pixel Curvilinear Extraction: Implements modern C++20 Steger ridge extraction using Gaussian scale-space second derivatives and sub-pixel Taylor zero-crossing along Hessian eigenvectors. It achieves ( < 0.0301 \text{ px} ) RMSE against analytical ground truth, passing our strict ( < 0.1 \text{ px} ) scientific quality gate across 41 green test suites.
  2. Quantitative Flood Delta & Geomorphological Interpretation: Ingests multi-temporal Sentinel-2 L2A 10m imagery, executes sub-pixel ECC co-registration (0.154 px shift), dynamically masks monsoon clouds, and calculates run-length channel width proxies. On the Nepal disaster corridor, it proved:
    • Median active water channel width expanded by +121.1% (19.0 px to 42.0 px, a 2.211x ratio).
    • Flood signature surged +88.4% (1.884x ratio).
    • Validated against a Spatial Control (off-river mountain slope ratio = 0.151x) and Temporal Baseline Control (0.905x), mathematically proving the signal is strictly localized to the disaster corridor without false positives.
    • Correctly identified a -9.0% ridge count reduction as physical terrain smoothing caused by pulverized glacial debris aprons filling bedrock fractures.
  3. Autonomous Agentic Decision Loop (AWS Bedrock): When the C++ engine writes flood_delta.json to S3, an EventBridge rule triggers a Claude 3.5 Sonnet v2 Bedrock Agent executing an authentic 3-node Perception-to-Action loop:
    • Perception (getFloodEvidence): Autonomously retrieves scientific metrics and issues a cryptographic evidenceToken.
    • Reasoning: Verifies flood signals, channel widening, and spatial controls against strict disaster policy thresholds.
    • Action (dispatchFloodAlert): Validates the evidenceToken, checks DynamoDB server-side idempotency, broadcasts emergency SNS alerts, and seals an immutable audit receipt to S3.
  4. Cloud-Optimized Vector Acceleration (COOL on Graviton3): Deploys the heavy C++ scale-space tensor engine to AWS Graviton3 (c7g.2xlarge) using the Cloud-Optimized OpenCV Library (COOL) with Neoverse V1 SIMD vectorization.

Special Category Focus

1. Best Use of COOL

The heavy C++20 scale-space tensor engine deploys to AWS Graviton3 (c7g.2xlarge) using the Cloud-Optimized OpenCV Library (COOL) with Neoverse V1 SIMD vectorization — with zero code modifications to the core math engine.

We benchmarked 100 continuous iterations of Steger curvilinear extraction on full-resolution ( (893 \times 1172 \text{ px}) ) disaster imagery with the identical binary. The test harness verifies the active SIMD path via cv2.getBuildInformation() (logged NEON_DOTPROD, NEON_FP16, NEON_BF16 dispatch) and models cost against AWS on-demand rates:

Metric (100-Iteration Measured Run) Value
Latency P50 213.6 ms
Latency Mean / P95 217.4 ms / 255.8 ms
Cost Per Disaster Scene $0.0000197
Throughput Per $1.00 USD 50,744 scenes

scripts/benchmark_cool_vs_x86.sh is platform-aware: on AWS Graviton3 it links COOL from /opt/opencv-cool, compiles with -mcpu=neoverse-v1, and emits the Graviton3-vs-x86 latency and cost comparison. Judges can reproduce this end-to-end with the point-and-run EC2 procedure in docs/aws_benchmark_guide.md.

2. Agentic Vision

Unlike conventional systems where an orchestrator pre-digests metrics and requests an LLM to rubber-stamp a pre-packaged decision, our architecture enforces a verifiable Perception → Decision → Action loop:

  • Perception Tool (getFloodEvidence): The agent receives only the eventId. It must autonomously invoke the tool to inspect metrics, registering a PENDING state in DynamoDB and acquiring a signed evidenceToken.
  • Decision Engine: Claude 3.5 Sonnet v2 acts as a strict policy enforcer, evaluating multi-condition scientific thresholds (channel expansion ( \ge 1.5\text{x} ), spatial slope ( < 0.5\text{x} )).
  • Action Tool (dispatchFloodAlert): Requires the valid evidenceToken. Lambda enforces server-side idempotency against DynamoDB, eliminating duplicate alerts on S3 retries, writes immutable receipts to an isolated audit bucket, and broadcasts via SNS.
  • Vision Output Changes Action (Both Directions): With full disaster evidence, the trace triggers an emergency SNS dispatch (run_agentic_vision_demo.py). With identical pipeline plumbing but pre-disaster magnitudes (--scenario marginal), the agent autonomously records a verified NOT_DISPATCHED standby decision with its own audit receipt — the OpenCV 5 measurement, not the model, decides.

How We Built It

  • Core Engine: C++20, OpenCV 5, CMake Presets, Clang-Format 18, Clang-Tidy, and GoogleTest (41/41 passing test suites).
  • Cloud Infrastructure (IaC): AWS CDK v2 (Python 3.12) managing 4 decoupled stacks (StorageStack, AlertStack, IAMStack, AgentStack).
  • Cloud Services: Amazon S3 (Data + Dedicated Audit Bucket), Amazon DynamoDB (Idempotency & State), Amazon SNS, Amazon SQS, AWS Lambda, Amazon EventBridge, Amazon Bedrock (Claude 3.5 Sonnet v2), AWS Graviton3 EC2.
  • Geospatial & 3D Visualization: Cesium 3D digital twin running locally at localhost:3000 with 6 calibrated camera frustums and ground-level bridge pier monitoring stills.
  • Judges' Reproducibility: The complete multi-stage system runs judge-side with zero cloud credentials (docs/JUDGES_QUICKSTART.md); all 8 submission gates are auditable in one command.

Challenges We Ran Into

  • Eliminating False Positives in Alpine Valleys: Cloud shadows and variable monsoon lighting caused heavy noise in naive gradient filters. We solved this by implementing Gaussian scale-space second derivatives and engineering dual spatial and temporal controls into the C++ pipeline to mathematically guarantee that detected signals were isolated to the flood channel.
  • Agentic Hallucinations: Early agent testing showed LLMs occasionally inventing coordinates or triggering alerts on marginal data. Implementing the cryptographic evidenceToken handoff and server-side DynamoDB validation completely resolved this, constraining the agent to act strictly on verified OpenCV 5 evidence.

What We Learned

  • Alpine debris floods cause dramatic high-frequency texture loss due to pulverized sediment deposition. A drop in curvilinear feature count, when paired with a widening active water thread, is a definitive geomorphological indicator of catastrophic debris aprons smoothing fractured bedrock.
  • Server-side cryptographic token handoffs paired with DynamoDB idempotency tables are essential for building reliable, production-ready agentic systems in safety-critical domains.

What's Next for vision-perception

  • Integrating multi-constellation radar (Sentinel-1 SAR) to achieve 24/7 all-weather penetration through thick monsoon clouds.
  • Deploying the Cesium 3D digital twin to mobile field tablets for real-time edge synchronization with search and rescue teams.

Built With

  • amazon-dynamodb
  • amazon-eventbridge
  • amazon-sns
  • amazon-sqs
  • amazon-web-services
  • arm-neon-simd
  • aws-bedrock
  • aws-cdk
  • aws-graviton3
  • aws-lambda
  • c++20
  • cesium-3d
  • claude-3-5-sonnet
  • computer-vision
  • cool
  • curvilinear-perception
  • disaster-response
  • opencv5
  • sentinel-2
Share this project:

Updates

Submission history