Coder Social home page Coder Social logo

toucanmeister / prettify Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 43.92 MB

Prettify is a simple command-line based scanned document enhancer created as a project for the course "Algorithm Engineering" in the winter semester of 2021/2022 at the FSU Jena.

C++ 49.30% TeX 49.49% CMake 1.21%

prettify's Introduction

prettify

Prettify is a simple command-line based scanned document enhancer created as a project for the course "Algorithm Engineering" in the winter semester of 2021/2022 at the FSU Jena. See paper for the accompanying report.

Features

Prettify works with P3 (ASCII-encoded) portable pix map (.ppm) images. To convert to and from this format, I recommend IrfanView or convert on Linux.

Prettify brings 6 routines to edit images you give it:

  • Mean Filter: Removes gausssian noise, but blurrs some edges with high radii
  • Gauss Filter: Does the same thing as the mean filter but does not create high-frequency artifacts; is a bit slower
  • Median Filter: Removes noise, especially salt-and-pepper noise, without blurring as much as mean or gauss filter
  • Global Threshold: Removes backgrounds in images with clear brightness separation between fore- and background
  • Adaptive Mean Threshold: Removes backgrounds and shadows in text-only images
  • Adaptive Gaussian Threshold: Removes backgrounds and shadows in text-only images, sometimes leaves fewer speckles than adaptive mean threshold

A standard call to improve a scanned document image img.ppm would be:

./prettify img.ppm img_out.ppm median threshold_mean 4 10 gauss

In this call prettify:

  • reads img.ppm
  • applies a median filter with default radius
  • applies an adaptive mean threshold with radius 4 and offset 10
  • applies a gauss filter with default radius
  • writes the finished image to img_out.ppm

Usage

For more information on how to use prettify, run prettify -h or prettify --help.

Installation

Prettify is written in C++ and thus needs to be compiled on your computer. This also means you will need a C++ compiler, CMake and the OpenMP library installed on your PC.

After downloading the source files, use a command line to go into the folder project.

Run the command cmake -B build.

Then run the command cmake --build build.

The usable executable will be at build/prettify.

Tip: To check that the program works correctly, you can test it: Go into the folder build and run ctest.

prettify's People

Contributors

toucanmeister avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.