I run a Shopify store that lets customers upload photos of their eyeglass prescriptions. Shadows, uneven lighting, skew, and low contrast in those real-world shots make my downstream OCR miss key fields. I need a robust pre-processing pipeline—built with OpenCV and related Python tools—that takes the raw JPG or PNG, corrects it, and returns a clean image ready for Tesseract (or any OCR engine) to read accurately. Here’s what the module must do: • Detect the prescription sheet, deskew it, and fix perspective so text lines are straight. • Normalize illumination, boost contrast, and suppress colour casts from shadows. • Reduce noise, deblur when possible, and sharpen strokes so both printed and handwritten text stand out. Deliverables & acceptance criteria • Well-structured Python code (OpenCV, NumPy, optional scikit-image) packaged as either a standalone script or a callable function that fits into a Shopify Cloud Function. • Given a test set of 100 customer photos I’ll supply, the pipeline should let Tesseract reach at least 90 % word-level accuracy on the main prescription fields. • Clean, commented source, plus a concise README explaining local testing and Shopify integration (input as file path or buffer, output as processed image / base64). • No reliance on paid SaaS; open-source libraries only. If you have previous document-image or prescription-processing examples, feel free to share before–after samples or repo links. I’m eager to put this into production quickly and will provide immediate feedback and test data.