Leptonica 1.68
C Image Processing Library

binreduce.c File Reference

Power of 2 integer reduction of 1 bpp images by sampling and rank value. More...

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "allheaders.h"

Go to the source code of this file.

Functions

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)

Detailed Description

Power of 2 integer reduction of 1 bpp images by sampling and rank value.

    Subsampled reduction

         PIX    *pixReduceBinary2()

    Rank filtered reductions

         PIX    *pixReduceRankBinaryCascade()
         PIX    *pixReduceRankBinary2()

Definition in file binreduce.c.


Function Documentation

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

Definition at line 47 of file binreduce.c.

References ERROR_PTR, FREE, makeSubsampleTab2x(), NULL, pixCopyResolution(), pixCreate(), pixGetData(), pixGetDepth(), pixGetHeight(), pixGetWidth(), pixGetWpl(), pixScaleResolution(), PROCNAME, and reduceBinary2Low().

Referenced by main().

PIX* pixReduceRankBinaryCascade ( PIX pixs,
l_int32  level1,
l_int32  level2,
l_int32  level3,
l_int32  level4 
)
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.

Definition at line 177 of file binreduce.c.

References ERROR_PTR, FREE, makeSubsampleTab2x(), NULL, pixCopyResolution(), pixCreate(), pixGetData(), pixGetDepth(), pixGetHeight(), pixGetWidth(), pixGetWpl(), pixScaleResolution(), PROCNAME, and reduceRankBinary2Low().

Referenced by main(), and pixReduceRankBinaryCascade().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines