All Projects → feramhq → Perspec

feramhq / Perspec

Licence: AGPL-3.0 license
Scriptable desktop app to correct the perspective of images

Programming Languages

haskell
3896 projects
shell
77523 projects
Makefile
30231 projects
HTML
75241 projects

Projects that are alternatives of or similar to Perspec

Desktop
A comprehensive solution for convenient and efficient work with notes, snippets, clipboard, files, and other information that requires quick access via any device.
Stars: ✭ 123 (-76.48%)
Mutual labels:  desktop-app, linux-app, macos-app
antares
A modern, fast and productivity driven SQL client with a focus in UX.
Stars: ✭ 836 (+59.85%)
Mutual labels:  desktop-app, linux-app, macos-app
Steamtools
🛠「Steam++」是一个开源跨平台的多功能Steam工具箱。
Stars: ✭ 4,458 (+752.39%)
Mutual labels:  linux-app, macos-app
Electron Xiami
虾米音乐 & 虾米电台 - Linux & Mac | Xiami Player & Xiami Radio desktop for Linux & Mac supported by Electron
Stars: ✭ 304 (-41.87%)
Mutual labels:  linux-app, macos-app
All platform example
Flutter example cross-platform application for mobile, desktop and web
Stars: ✭ 56 (-89.29%)
Mutual labels:  linux-app, macos-app
Aether App
Aether client app with bundled front-end and P2P back-end
Stars: ✭ 951 (+81.84%)
Mutual labels:  desktop-app, linux-app
Inboxer
Unofficial, free and open-source Inbox by Gmail Desktop App
Stars: ✭ 668 (+27.72%)
Mutual labels:  linux-app, macos-app
Moonlight Qt
GameStream client for PCs (Windows, Mac, Linux, and Steam Link)
Stars: ✭ 2,796 (+434.61%)
Mutual labels:  linux-app, macos-app
Tauonmusicbox
The Linux desktop music player from the future! 🌆
Stars: ✭ 494 (-5.54%)
Mutual labels:  desktop-app, linux-app
MaCoPiX
Mascot Constructive Pilot for X
Stars: ✭ 57 (-89.1%)
Mutual labels:  linux-app, macos-app
xmap
XMap is a fast network scanner designed for performing Internet-wide IPv6 & IPv4 network research scanning.
Stars: ✭ 190 (-63.67%)
Mutual labels:  scanning
Norka
Continuous text editor for Linux
Stars: ✭ 70 (-86.62%)
Mutual labels:  linux-app
fhash
fHash - an open source files hash calculator for Windows and macOS
Stars: ✭ 222 (-57.55%)
Mutual labels:  desktop-app
nw-angular-cli-example
An example of an Angular CLI app running in NW.js
Stars: ✭ 24 (-95.41%)
Mutual labels:  desktop-app
keystone-email
⚠️ Archived - Legacy email helper for KeystoneJS Apps
Stars: ✭ 30 (-94.26%)
Mutual labels:  keystone
photomosaics
Python program that makes a photo mosaic out of a given image
Stars: ✭ 25 (-95.22%)
Mutual labels:  photo
GreynirCorrect
Spelling and grammar correction for Icelandic
Stars: ✭ 12 (-97.71%)
Mutual labels:  correction
source-me
ℹ️ A small, minimal application built with Electron which provides necessary tools needed for web development.
Stars: ✭ 91 (-82.6%)
Mutual labels:  desktop-app
Covid-19 Ampel
Covid-19_Ampel | Zeigt neben der 7-Tage-Inzidenz weitere Infos zu einer Region.
Stars: ✭ 33 (-93.69%)
Mutual labels:  scriptable
notion-linux-wrapper
Notion.so desktop application for Linux
Stars: ✭ 37 (-92.93%)
Mutual labels:  linux-app

Icon Perspec

App and workflow to perspectively correct images. For example whiteboards, document scans, or facades.

App Workflow

Step Description Result
1 Take photos Original image
2 Open Perspec app Opened Perspec App
3 Drop the images onto the window Dropped image
4 Mark the corners by clicking on them Marked corners
5 Click one of the save buttons (or [Enter]) Corrected image

Installation

WARNING: Perspec currently only works on macOS and Linux. Any help to make it work on Microsoft (Ticket) would be greatly appreciated!

Prebuilt

You can get this (and previous) versions from the releases page.

The current nightly version can be downloaded from https://github.com/feramhq/Perspec/actions. However, it's necessary to fix the file permissions after download:

chmod +x \
  ./Perspec.app/Contents/MacOS/Perspec \
  ./Perspec.app/Contents/Resources/{perspec,script,imagemagick/bin/convert}

On macOS you can also install it via this Homebrew tap:

brew install --cask ad-si/tap/perspec

From Source

Build it from source with Haskell's stack.

Platypus, with command line tools enabled , is required to build from source.

git clone https://github.com/feramhq/Perspec
cd Perspec
make install

This copies the Perspec.app to your /Applications directory and makes the perspec command available on your path. You can then either drop images on the app window, or use it via the CLI like perspec fix image.jpeg

Usage via CLI

It's also possible to directly invoke Perspec via the CLI like so:

/Applications/Perspec.app/Contents/Resources/perspec fix path/to/image.jpeg

You can also pass several images and they will all be opened one after another. This is very useful for batch correcting a large set of images.

Photo Digitization Workflow

  1. Take photos
    1. Use camera app which lets you lock rotation (e.g. OpenCamera). Otherwise check out the guide below to fix rotation.
    2. Use a sound activated camera to take photos simply by clicking your tongue or snipping your finger. E.g. with:
  2. Use perspec rename sub-command to fix order and names of scanned files.
  3. Verify that
    • All pages were captured and have the correct filename
    • Images are sharp enough
    • Images have a high contrast
    • Images have correct orientation
  4. For best image quality convert images optionally to a lossless format (e.g. png), apply rotations, and convert them to grayscale. Attention: Exclude the covers!
    mogrify -verbose -format png \
      -auto-orient -colorspace gray photos/*.jpeg
  5. Use Perspec to crop images
    perspec fix photos/*.png

Additional Steps

Improve colors with one of the following steps:

  1. Normalize dynamic range:
mogrify -verbose -normalize photos/*.png
  1. Convert to black and white:
    #! /usr/bin/env bash
    
    find . -iname "*.png" | \
    while read -r file
    do
      convert \
        -verbose \
        "$file" \
        \( +clone -blur 0x60 -brightness-contrast 40 \) \
        -compose minus \
        -composite \
        -negate \
        -auto-threshold otsu \
        "$(basename "$file" ".png")"-fixed.png
    done

In order to rotate all photos to portrait mode you can use either

mogrify -verbose -auto-orient -rotate "90>" photos/*.jpeg

or

mogrify -verbose -auto-orient -rotate "-90>" photos/*.jpeg

Features

  • Rescale image on viewport change
  • Handle JPEG rotation
  • Draw lines between corners to simplify guessing of clipped corners
  • Bundle Imagemagick
  • Better error if wrong file format is dropped (images/error-message.jpg)
  • Center Perspec window on screen
  • Drag'n'Drop for corner markers
  • "Submit" button
  • "Convert to Grayscale" button
  • Add support for custom output size (e.g. A4)
  • Manual rotation buttons
  • Zoom view for corners
  • Label corner markers

Algorithms

Perspective Transformation

Once the corners are marked, the correction is equivalent to:

convert \
  images/example.jpg \
  -distort Perspective \
    '8,35 0,0 27,73 0,66 90,72 63,66 67,10 63,0' \
  -crop 63x66+0+0 \
  images/example-fixed.jpg

Grayscale Conversion

Converts image to grayscale and normalizes the range of values afterwards. (Uses Imagemagick's -colorspace gray -normalize)

BW Conversion

Converts image to binary format with OTSU's method. (Uses Imagemagick's -auto-threshold OTSU -monochrome)

Interpolation of Missing Parts

Perspec automatically interpolates missing parts by using the closest pixel. (https://www.imagemagick.org/Usage/misc/#edge)

Technologies

Related

Check out ad-si/awesome-scanning for an extensive list of related projects.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].