sourabhkhemka/DocumentScanner — reverse-engineered prompt

Reverse engineered prompt

Build me a document scanner that works from ordinary photos of papers and makes them look like clean scanned documents, similar to Adobe Scan or Microsoft Lens. Use OpenCV, keep the main version in Java, and make the code easy to reuse later for Android. If there is already a matching Python version of the same scan logic, keep that in sync too, but the Java flow is the priority.

I want a simple way to feed in an image and get back a scanned result in a few useful modes, with a small runnable example that shows how to call it. It is fine if a couple of tuning values still need to be set manually, just expose them clearly and give reasonable defaults. Do not try to add automatic cropping if that part is not ready yet. Focus on the actual scan quality and a clean output image.

Please also include clear setup and run steps, sample input and output locations, and brief notes on what each scan mode is best for. Look up current docs online if you need to.

Want more depth? Deep Reverse