Inspiration

A missing component can be overlooked, while shadows or camera movement can look like defects. Small assembly teams need a practical way to investigate visible changes and document their decisions.

I built InspectLoop around one principle: evidence before action. A reviewer should see what changed, understand the comparison, and remain responsible for the final decision.

What it does

InspectLoop compares a reference image with a candidate using OpenCV 5. It checks capture quality, attempts exposure recovery when appropriate, aligns images, and highlights candidate change regions.

The interface shows original images, an overlay, a difference mask, and a measured decision trace. Results request a retake, flag changes for review, or report no significant change.

A person can confirm or dismiss a finding and download a JSON evidence report. The application never automatically rejects a product.

How I built it

I used Python 3.12, OpenCV 5, NumPy, Flask, HTML, CSS, and JavaScript.

The vision pipeline combines brightness and sharpness measurements, ORB feature matching, RANSAC-based affine alignment, grayscale difference masks, morphological processing, and contour-based region refinement.

A deterministic controller chooses processing steps from measured evidence. No LLM or trained defect model is used in the inspection pipeline.

The application runs on AWS Lambda behind API Gateway. Amazon S3 stores reports, Amazon ECR stores the container image, and Docker with AWS SAM supports repeatable deployment.

The repository includes pinned dependencies, setup instructions, automated tests, evaluation outputs, architecture diagrams, and a technical report.

Challenges I ran into

Camera movement, shadows, and background changes can produce misleading differences. A portrait photo pair exposed an alignment limitation, leading to a normalized movement check and shared-overlap validation.

The real-photo example still produces extra background and alignment flags. These are documented limitations, not confirmed defects.

An initial Lambda deployment encountered an account concurrency restriction. Updating the deployment configuration allowed deployment to succeed.

Accomplishments I'm proud of

I deployed a working OpenCV 5 application on AWS and demonstrated inspection, evidence visualization, human review, and report export.

Cloud checks reported OpenCV 5.0.0 on Lambda with S3 storage. An unauthenticated inspection returned HTTP 401, and a persisted report was successfully retrieved through the application.

In a real-photo development example, the removed eraser area was highlighted among 17 flagged regions, with 3.188% changed area. Additional background flags remained. These numbers describe that example; they are not accuracy measurements.

An identical-photo comparison returned zero flagged regions. This checks identical-input handling, not performance on separately captured unchanged scenes.

Synthetic evaluation outputs and explicit failure cases are included in the repository.

What I learned

Useful inspection requires more than highlighting differences. Capture quality, alignment, uncertainty, and human interpretation all affect the result.

I learned how to package an OpenCV workload for AWS Lambda and connect visual evidence to a persistent human review decision.

What's next for InspectLoop: Evidence Before Action

Collect independently labeled photo pairs, compare against a simple image-difference baseline, and measure missed changes and nuisance flags.

Improve handling of background and lighting variation, evaluate mobile usability, and add individual reviewer identity with conflict-safe review updates.

Responsible use and development disclosure

InspectLoop is a research prototype for human-assisted visual comparison. It is not a certified industrial inspection system. Independent industrial accuracy and quantified business benefits have not been established.

Reports contain normalized images. Hosted inspection operations require a shared access token, and the S3 deployment includes encryption and a report lifecycle policy.

ChatGPT and Codex assisted with implementation, debugging, tests, and documentation. I performed AWS deployment, captured the real photographs, and exercised the browser workflow. Synthetic sample artwork is generated by the project's code.

Built With

Share this project:

Updates

Submission history