About the project

Municipal offices and archives often deal with scans that are crooked, blurry, faded, or missing part of the page. I started with a simple question: how can we tell whether a scanned page is reliable enough before passing it to OCR or an AI system?

PageReady Vision grew from that question. It checks document quality and decides what should happen next. A clear page can proceed, a slightly skewed page can be corrected, and a severely blurred page needs a new scan. When the evidence is uncertain, the page goes to a person for review.

I built the application using React, FastAPI, and OpenCV 5. At its core is QualityGateAgent, a deterministic agent that uses OpenCV measurements to assess skew, blur, contrast, and possible issues at the frame edges. Its workflow follows four steps:

QualityGateAgent → OpenCV analysis → action tool → OpenCV verification

Getting skew correction right was particularly important. OpenCV measures the page angle, and the auto_correct tool uses that measurement to straighten the image. OpenCV then checks the corrected page again. The agent approves it only when verification succeeds; otherwise, it sends the page for human review. That second check matters because applying a correction does not guarantee a usable result.

The hardest part was deciding how much to automate. Automatically “fixing” every page might look impressive in a demo, but it could hide problems in archive documents. I therefore kept the decisions cautious: severe blur triggers a rescan request, while low contrast and possible frame-edge problems require human review. A clerk must also record a reason before approving a reviewed page.

I learned that these decisions need to be easy to follow. Each page produces a chronological audit trace containing the OpenCV runtime version, measured evidence, selected action, tool calls, verification results, and final outcome. The trace contains no document images. In the current evaluation, the four representative cases—clean, skewed, blurred, and low-contrast pages—produced all four expected outcomes, with zero unsafe approvals across those cases.

PageReady Vision runs as a live Docker web application on AWS EC2 Graviton. Building it taught me that responsible automation includes knowing when to stop. Sometimes the right action is to correct a page; sometimes it is to request a better scan or ask a person to make the decision.

Built With

Share this project:

Updates

Submission history