Leptonica is an open source library containing software that is broadly useful for image processing and image analysis applications.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
6.3 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
6 years ago
  1. # Leptonica Library #
  2. [![sw](https://github.com/DanBloomberg/leptonica/actions/workflows/sw.yml/badge.svg)](https://github.com/DanBloomberg/leptonica/actions/workflows/sw.yml)
  3. www.leptonica.org
  4. ## The library supports many operations that are useful on ##
  5. * Document images
  6. * Natural images
  7. ## Fundamental image processing and image analysis operations ##
  8. * Rasterop (aka bitblt)
  9. * Affine transforms (scaling, translation, rotation, shear) on images of arbitrary pixel depth
  10. * Projective and bilinear transforms
  11. * Binary and grayscale morphology, rank order filters, and convolution
  12. * Seedfill and connected components
  13. * Image transformations with changes in pixel depth, both at the same scale and with scale change
  14. * Pixelwise masking, blending, enhancement, arithmetic ops, etc.
  15. ## Ancillary utilities ##
  16. * I/O for standard image formats (_jpg_, _png_, _tiff_, _webp_, _jp2_, _bmp_, _pnm_, _gif_, _ps_, _pdf_)
  17. * Utilities to handle arrays of image-related data types (e.g., _pixa_, _boxa_, _pta_)
  18. * Utilities for stacks, generic arrays, queues, heaps, lists, sets, ordered maps, hashmaps; number and string arrays; etc.
  19. ## Examples of some applications enabled and implemented ##
  20. * Octcube-based color quantization (w/ and w/out dithering)
  21. * Modified median cut color quantization (w/ and w/out dithering)
  22. * Determination of skew and orientation of text images
  23. * Adaptive background normalization and binarization
  24. * Segmentation of page images with mixed text and images
  25. * Color segmentation by clustering and seed-filling
  26. * Location of baselines and local skew determination
  27. * jbig2 unsupervised classifier
  28. * Border representations of 1 bpp images and raster conversion for SVG
  29. * Postscript generation (levels 1, 2 and 3) of images for device-independent output
  30. * PDF generation (G4, DCT, FLATE) of images for device-independent output
  31. * Connectivity-preserving thinning and thickening of 1 bpp images
  32. * Image warping (captcha, stereoscopic)
  33. * Image dewarping based on content (textlines)
  34. * Watershed transform
  35. * Greedy splitting of components into rectangles
  36. * Location of largest fg or bg rectangles in 1 bpp images
  37. * Search for least-cost paths on binary and grayscale images
  38. * Barcode reader for 1D barcodes (very early version as of 1.55)
  39. ## Implementation characteristics ##
  40. * _Efficient_: image data is packed binary (into 32-bit words); operations on 32-bit data whenever possible
  41. * _Simple_: small number of data structures; simplest implementations provided that are efficient
  42. * _Consistent_: data allocated on the heap with simple ownership rules; function names usually begin with primary data structure (e.g., _pix_); simple code patterns throughout
  43. * _Robust_: all ptr args checked; extensive use of accessors; exit not permitted
  44. * _Tested_: over 140 regression tests provided for basic functions and applications; valgrind tested
  45. * _ANSI C_: automatically generated prototype header file
  46. * _Portable_: endian-independent; builds in Linux, macOS, MinGW, Cygwin, Windows
  47. * _Thread-safe_: uses atomic operations for reference counting
  48. * _Documentation_: large number of in-line comments; doxygen; web pages for further background
  49. * _Examples_: many programs provided to test and show usage of over 2700 functions in the library
  50. ## Open Source Projects that use Leptonica ##
  51. * [tesseract](https://github.com/tesseract-ocr/tesseract/) (optical character recognition)
  52. * [OpenCV](https://github.com/opencv/opencv) (computer vision library)
  53. * [jbig2enc](https://github.com/agl/jbig2enc) (encodes multipage binary image documents with jbig2 compression)
  54. ## Major contributors to Leptonica ##
  55. * Jeff Breidenbach: Jeff has built every Debian distribution for Leptonica. He has also made many improvements to formatted image I/O, including tiff, png and pdf. He is a continuous and practical advocate for simplification.
  56. * David Bryan: David has worked for years to support Leptonica on multiple platforms. He designed many nice features in Leptonica, such as the severity-based error messaging system, and has identified and fixed countless bugs. And he has built and tested many distribution on cross-compilers.
  57. * James Le Cuirot: James has written and supported the autotools scripts on Leptonica distributions for many years, and has helped test many recent distributions.
  58. * Egor Pugin: Egor is co-maintainer of Leptonica on GitHub. He ported everything, including all the old distributions, from Google Code when it shut down. He set Leptonica up for appveyor and travis testing, and has implemented the sw project, which simplifies building executables on Windows.
  59. * Stefan Weil: Stefan is a co-maintainer of Leptonica on GitHub. He has worked from the beginning to clean up the Leptonica GitHub distribution, including removing errors in the source code. Among other things: he suggested and implemented the use of Coverity Scan; made the library thread-safe by implementing atomic operations for reference counting; and helped remove internal struct data from the public interface.
  60. * Zdenko Podobny: Zdenko is a co-maintainer of Leptonica on GitHub. He has worked, mostly behind the scenes as a primary maintainer of tesseract, to help with Leptonica builds on all platforms, and coordinate with its use in tesseract.
  61. * Jürgen Buchmüller: Jürgen wrote text converters to modify Leptonica source code so that it generates documentation using doxygen. He also wrote tiff wrappers for memory I/O.
  62. * Adam Korczynski: Adam is an expert in testing libraries for safety. He has built most of the open source fuzzers for Leptonica in the oss-fuzz project, with significant code coverage.
  63. * Tom Powers: Tom supported the port of Leptonica to Windows for many years. He made many contributions to code quality and documentation.
  64. ## Installing Leptonica (vcpkg)
  65. * You can build and install Leptonica using [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
  66. ``` sh or powershell
  67. git clone https://github.com/Microsoft/vcpkg.git
  68. cd vcpkg
  69. ./bootstrap-vcpkg.sh # "./bootstrap-vcpkg.bat" for powershell
  70. ./vcpkg integrate install
  71. ./vcpkg install leptonica
  72. ```
  73. * The Leptonica port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.