Skip to content

Commit

Permalink
Added documentation for high-level adaptive binarization functions
Browse files Browse the repository at this point in the history
  • Loading branch information
DanBloomberg committed Feb 8, 2024
1 parent 4dc2e64 commit ee7cb15
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/adaptmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* adaptmap.c: local adaptive; mostly gray-to-gray in preparation
* for binarization
* binarize.c: special binarization methods, locally adaptive.
* pageseg.c: locally adaptive cleaning operation with several options
*
* -------------------------------------------------------------------
*
Expand Down Expand Up @@ -134,6 +135,15 @@
* useful for improving the appearance of pages with very light
* foreground or very dark background, and where the local TRC
* function doesn't change rapidly with position.
*
* Adaptive binarization is done in two steps:
* (1) Background normalization by some method
* (2) Global thresholding with a value appropriate to the normalization.
* There are several high-level functions in leptonica for doing adaptive
* binarization on grayscale and color images, such as:
* * pixAdaptThresholdToBinary() (in grayquant.c)
* * pixConvertTo1Adaptive() (in pixconv.c)
* * pixCleanImage() (in pageseg.c)
* </pre>
*/

Expand Down
2 changes: 2 additions & 0 deletions src/grayquant.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,8 @@ PIX *pixd;
* (1) This is a simple convenience function for doing adaptive
* thresholding on a grayscale image with variable background.
* It uses default parameters appropriate for typical text images.
* Other high-level adaptive thresholding functions are
* pixConvertTo1Adaptive() and pixCleanImage().
* (2) %pixm is a 1 bpp mask over "image" regions, which are not
* expected to have a white background. The mask inhibits
* background finding under the fg pixels of the mask. For
Expand Down
2 changes: 2 additions & 0 deletions src/pixconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2889,6 +2889,8 @@ PIX *pixs, *pixd;
* (1) This is a top-level function, that uses default values for
* adaptive thresholding, if necessary. Otherwise, it is the same as
* pixConvertTo1(), which uses a global threshold for binarization.
* (2) Other high-level adaptive thresholding functions are
* pixAdaptThresholdToBinary() and pixCleanImage().
* </pre>
*/
PIX *
Expand Down

0 comments on commit ee7cb15

Please sign in to comment.