[Leptonica Home Page]

Source Code and Information


Updated: Jun 28, 2014

    The road to wisdom? -- Well, it's plain
    and simple to express:
        Err
        and err
        and err again
        but less
        and less
        and less.

            --Piet Hein (Grooks)

Contents

This site contains well-tested C code for some basic image processing operations, along with a description of the functions and some design methods. A full set of affine transformations (translation, shear, rotation, scaling) on images of all depths is included, with the exception that some of the scaling methods do not work at all depths. There are also implementations of binary morphology, grayscale morphology, convolution and rank order filters, and applications such as jbig2 image processing and color quantization.

You will also find basic utilities for the safe and efficient handling of arrays (of strings, numbers, number pairs and image-related geometrical objects), byte queues, generic stacks, generic lists, and endian-independent indexing into 32-bit arrays.

There is a very high-level summary of the functions in the library. You can use this to quickly get an idea of where you may find a needed function.

Documentation external to the source code is provided for the following operations and applications:

  1. Rasterops

  2. Binary morphology

  3. Grayscale morphology

  4. Convolution

  5. Scaling

  6. Rotation

  7. Affine transformations

  8. Seed filling and connected components

  9. Applications:
  10. Grayscale and color image enhancement

  11. Grayscale mapping and binarization

  12. Connectivity-preserving thinning

  13. Playing around

Download

Click here to download the source. [ update: Jun 28, 2014 ]

Be sure to download the README as well.

If you are building the library and applications on Windows, read the developer notes by Tom Powers and download his Microsoft Visual Studio package from here.

Tom Powers has also built the Unofficial Leptonica Documentation using Sphinx. It covers all the information in these pages and is more easily navigated. You are encouraged to use it instead.

You may also find these pages useful:


Related Publications

Here are some references to selected papers on image processing and image analysis that you might find interesting.

Luc Vincent and I wrote a chapter on Document image analysis, in Mathematical morphology: theory and applications, published by ISTE-Wiley in June 2010. The book is is a compendium on topics in morphology, edited by Laurent Najman and Hugues Talbot. Here is a page that provides information, including the location of source code for running the applications and generating the figures for this chapter.


[Leptonica Home Page]

Creative Commons License
Leptonica by Dan Bloomberg is licensed under a Creative Commons Attribution 3.0 United States License.