Urgent.News

What's breaking now, across thousands of outlets.

Tech

Perspec 1.0: A Haskell desktop app for perspective correction of document photos

Perspec 1.0 is a new desktop application designed to correct the perspective of images, particularly those of documents and receipts. The developer, who has been working on the project for nine years, is pleased with the final product and hopes users will appreciate it too. The app aims to address the frustrations many people face when working with scanned documents on their phones or computers.

Unlike popular mobile scanning apps, Perspec offers a desktop solution that leverages a larger screen, keyboard, and precise mouse, making editing faster and more accurate. The app also improves upon mobile apps that often produce larger files with inferior image quality due to their reliance on JPEG format. Perspec's unique approach to document detection uses computer vision techniques to identify corners and build up the document, rather than relying on edge detection which can struggle with curved or wrinkled edges.

The developer started working on Perspec as a student, motivated by the need to scan various documents for their studies. While an earlier version was a fully automatic CLI app called Perspectra written in Python, the developer ultimately chose Haskell to build the GUI due to their newfound love for the language. Although the app uses ImageMagick for image manipulation tasks, the developer found its performance to be lacking for larger images.

OpenCV was considered but dismissed due to past negative experiences with C++ and the perceived difficulty of its Haskell bindings. Instead, the developer utilized Hip, a Haskell image processing library, which they helped develop with the assistance of @lehins and @HanStolpo. The final result is a streamlined, focused app designed to quickly and efficiently correct the perspective of document images, offering a more efficient workflow compared to traditional editing tools.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at adriansieber.com →

More in Tech

More from Monday 24 August →