The inspection problem

Inspection teams collect pole photographs, but a photo alone does not explain what changed or what needs checking next. Camera angle can exaggerate a tilt. A blurred edge can produce a confident-looking number that the image cannot support.

For example, a pole beside a school looks different this week. Did the pole move, did the camera move, or do we need a clearer observation? The reviewer needs the image, the earlier record and a reason to follow up.

What SpanWitness does

SpanWitness keeps dated utility observations together by asset. An operator selects a baseline and a later inspection, marks the pole and a fixed reference, then confirms a repeatable capture setup. The app checks whether the images support comparison. It measures an apparent image-alignment change or asks for better evidence.

The main demo first runs a real, openly licensed PD-Defect photograph through the hosted AWS app. Operator-marked pole and reference edges produce a 19.3-degree image-relative difference and a structural-review request. A second real photograph lacks enough pole-edge support; the app returns no angle and asks for clearer evidence. These are different assets, not a before/after pair.

Separately, the controlled history example compares a known drawn five-degree change with a camera-rotation control. The change requests a repeat capture and structural review. Shared camera rotation produces no change above the declared three-degree review threshold. Changed perspective and blur require another observation.

A reviewer can inspect both images, add a note and confirm a provisional review request. The export carries both observations, measurements and hashes. The original conductor and vegetation workflow also checks possible line interruptions and projected overlap, with a second-view comparison when useful.

How we built it

OpenCV 5 runs the image analysis. The pole path checks sharpness with Laplacian variance, finds Canny edges, filters their direction, selects long candidates with HoughLinesP and fits the selected pole and reference with Huber line fitting. It compares the fitted image orientations. The video shows actual intermediate outputs from this same analyze() function, not an illustrative simulation. The conductor and vegetation paths add color segmentation and geometric checks. The history path uses ORB feature matching with RANSAC. The history path excludes the marked pole from background registration and checks reference consistency and projective disagreement. A bounded rule policy chooses the next review action.

FastAPI serves the interface and API. The deployed AWS path runs the actual analysis in Lambda behind API Gateway. Private S3 holds evidence images; DynamoDB holds observations, comparisons and review requests. Local development uses SQLite. No paid model endpoint is required.

I built this solo with Codex for implementation, debugging, testing, deployment and demo preparation. The final narration is one continuous computer-generated voice, produced in Python with edge-tts and the en-US-AriaNeural voice. The current cover uses a credited real PD-Defect photograph. Earlier concept art is labeled as AI-generated. Application screenshots show the working prototype. The final 1080p video starts on the actual static UI, explains the problem and OpenCV processing, then covers AWS and the inspection walkthrough. It displays the actual preview address, live OpenCV/Lambda runtime and AWS CloudShell verification of the same S3 and DynamoDB records.

Challenges and what I learned

Subtracting image angles handles camera roll but does not solve perspective. A matching background also cannot prove identical 3D camera pose. The useful behavior is to decline an unsupported comparison, preserve earlier concerns and request a better observation.

Two local learned pole classifiers failed the declared acceptance boundary. Their weights and predictions are excluded from the app. The publisher's test split was not used to tune them. The report preserves these results and the earlier procedural failures.

Results and limits

  • 62 regression and API tests passed.
  • 144 single-observation checks and 36 second-view checks passed.
  • 108 controlled history variations passed, with no change alerts in their controls.
  • Live AWS checks verified OpenCV execution, stored image readback, comparison exports and persistence.

These are development and regression checks, not field accuracy. The original synthetic fixtures and illustrative dates are labeled. Four licensed field photographs have attribution. The two selected PD-Defect examples are functional demonstrations, not a blind accuracy evaluation. Their publisher labels are not analysis inputs. No workplace code or images are included.

The app does not diagnose cracks, measure physical pole lean, predict a fall date or calculate fire probability. Color candidates do not establish vegetation species or fuel moisture. Review priorities are prototype settings and require human assessment. No external crew message is sent.

What's next

Collect repeat observations with independent condition labels, evaluate across real camera changes and work with qualified inspectors on calibrated measurements. The immediate goal is an inspection record that the next reviewer can inspect and reproduce.

Real-photo credits

The two PD-Defect demonstration photographs are credited to Sampath Balaji Masabathula, Srija Vanapalli, Gangadhar Kanchi, Sreenivasa Rao V.A.N, Vijaya Lalitha V and Sasank Chilamkurthy. Source: EPDCL/pd-defect, publisher-declared CC BY 4.0. The original JPEG bytes are preserved; the app adds operator marks and evidence overlays. The cover crops the real photograph for layout. Exact sources, hashes and change notes.

Share this project:

Updates

Submission history