I'm looking for recommendations for a SaaS or a software library/SDK to deskew and crop photographed documents on a server.

Users take photographs of paper documents with a smartphone,

  • possibly with slightly crumpled paper,
  • on top of cluttered desks,
  • at imperfect angles.

They upload it in a web application. On the server, we want to:

  • detect the document edges in the photograph
  • deskew the document: rotate and correct perspective
  • crop the image to the document edges
  • (optional) turn the image into a black and white image with proper levels

The end result should be as close to a good scan of the document as possible. These are image preprocessing steps before passing the resulting image to a OCR and document extraction service that usually handles document scans. The Saas/library should work reliably and free of manual interventions. The results should be very good / state-of-the-art. Potential solutions I've found:

  • ABBYY FineReader Engine
  • Inlite ClearImage Image Processing SDK
  • LEADTOOLS Document Image Cleanup and Pre-processing SDK
  • Cloudmersive Automatic Image Semgentation and Preprocessing
  • ImageMagick: there are some deskew/crop scripts floating about which might be useful starting points, but this still requires development time and our results wouldn't be as good as what specialized SaaSs and SDKs provide.
  • OpenCV: same considerations apply.

Have I overlooked offerings by Google, Microsoft, Amazon and other big Cloud providers? Google Vision API's crop hints seem to not include document edge detection and deskewing, and the only APIs from MS I've found which seem relevant are "Encodian -> Image Clean Up (Document)" and "Image Clean Up (Photo)". Any others I've missed?

  • Your question mentions my employer’s SDK, LEADTOOLS, so I wanted to provide a side-note about it. This SDK has fully functional time-limited free evaluation editions for different server and mobile platforms. You can find them here. There’s also free email and online chat support, even during evaluation. So I recommend trying both our evaluation and our support before deciding on a product. – Amin Dodin Aug 1 '19 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.