Leptonica  1.54
Файл src/binreduce.c
#include <string.h>
#include "allheaders.h"

Функции

PIXpixReduceBinary2 (PIX *pixs, l_uint8 *intab)
PIXpixReduceRankBinaryCascade (PIX *pixs, l_int32 level1, l_int32 level2, l_int32 level3, l_int32 level4)
PIXpixReduceRankBinary2 (PIX *pixs, l_int32 level, l_uint8 *intab)

Функции

PIX* pixReduceBinary2 ( PIX pixs,
l_uint8 intab 
)

pixReduceBinary2()

Input: pixs tab (<optional>; if null, a table is made here and destroyed before exit) Return: pixd (2x subsampled), or null on error

PIX* pixReduceRankBinary2 ( PIX pixs,
l_int32  level,
l_uint8 intab 
)

pixReduceRankBinary2()

Input: pixs (1 bpp) level (rank threshold: 1, 2, 3, 4) intab (<optional>; if null, a table is made here and destroyed before exit) Return: pixd (1 bpp, 2x rank threshold reduced), or null on error

Notes: (1) pixd is downscaled by 2x from pixs. (2) The rank threshold specifies the minimum number of ON pixels in each 2x2 region of pixs that are required to set the corresponding pixel ON in pixd.

PIX* pixReduceRankBinaryCascade ( PIX pixs,
l_int32  level1,
l_int32  level2,
l_int32  level3,
l_int32  level4 
)

pixReduceRankBinaryCascade()

Input: pixs (1 bpp) level1, ... level 4 (thresholds, in the set {0, 1, 2, 3, 4}) Return: pixd, or null on error

Notes: (1) This performs up to four cascaded 2x rank reductions. (2) Use level = 0 to truncate the cascade.