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

After 9 years of on-and-off development, I’m happy to announce the 1.0 release of Perspec, a desktop app for correcting the perspective of photos of documents, receipts, and whiteboards.

The headline feature of 1.0 is automatic corner detection: instead of the usual edge-detection + Hough transform pipeline, it segments the document via watershed segmentation and finds corners, which handles wrinkled receipts and curved book pages much better. And if the detection is off, you can just drag the selection polygon to fix it.

Some Haskell-relevant bits:

  • The GUI is built with Brillo, my maintained fork of gloss.
  • The computer vision runs in FlatCV, a pure C library I wrote for this, called via Haskell’s FFI.
  • With 1.0, Perspec now runs on macOS, Linux, and Windows.

The full announcement covers the journey (Python → ImageMagick → Hip → C FFI), the corner detection pipeline, and the binarization algorithms in detail:

Looking forward to you feedback! :blush:

21 Likes