Coder Social home page Coder Social logo

local_adaptive_binarization's Introduction

Local Adaptive Binarization

alt text

This code uses an improved contrast maximization version of Niblack/Sauvola et al's method to binarize document images. It is also able to perform the more classical Niblack as well as Sauvola et al. methods. Details can be found in the ICPR 2002 paper.

You need to cite the following paper when you use this code :

Christian Wolf, Jean-Michel Jolion and Francoise Chassaing. 
Text Localization, Enhancement and Binarization in Multimedia Documents. 
International Conference on Pattern Recognition (ICPR), 
volume 4, pages 1037-1040, 2002. 

Usage:

The executable is called on the command line and only reads and writes PGM files. Under Linux you can use for instance "convert" (part of the ImageMagick package) to convert to and from the PGM format. The first argument chooses between one of several methods, the first and the second argument specify, respectively, the input and the output file:

usage: binarize [ -x  -y  -k  ] [ version ]  

version: n   Niblack (1986)         needs white text on black background
         s   Sauvola et al. (1997)  needs black text on white background
         w   Wolf et al. (2001)     needs black text on white background

Default version: w (Wolf et al. 2001)
Default value for "k": 0.5

example:
       binarize w in.pgm out.pgm
       binarize in.pgm out.pgm
       binarize s -x 50 -y 50 -k 0.6 in.pgm out.pgm

The best working method is 'w', the one which performed 5th in the DIBCO 2009 competition.

If no further arguments are provided, than the window sizes are estimated automatically. The argument -k sets the "k" parameter from all 3 papers.

IMPORTANT! Note, that the parameter should be set differently according! It might be necessary to set a different parameter for Niblack's method (he recommends -0.2 in his paper).

Compilation

The code has been developed under Linux. No project files are provided for Windows, although the code should in principle compile under Windows.

Credits

This code was written by Christian Wolf.

Patched by Thibault Yohan for faster speed (uses open-cv integral images.)

GIMP/Python version

A GIMP Plugin written in Python has been written by Vincent Vansuyt (thanks!). He provides the plugin upon request : http://www.vvpix.com.

Licence

Permission is granted for anyone to copy, use, modify, or distribute this program and accompanying programs and documents for any purpose, provided this copyright notice is retained and prominently displayed, along with a note saying that the original programs are available from my web page.

The programs and documents are distributed without any warranty, express or implied. As the programs were written for research purposes only, they have not been tested to the degree that would be advisable in any important application.

All use of these programs is entirely at the user's own risk.

You need to cite the following paper when you use this code :

Christian Wolf, Jean-Michel Jolion and Francoise Chassaing. 
Text Localization, Enhancement and Binarization in Multimedia Documents. 
International Conference on Pattern Recognition (ICPR), 
volume 4, pages 1037-1040, 2002. 

local_adaptive_binarization's People

Contributors

chriswolfvision avatar

Watchers

James Cloos 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.