Файл src/rank.c

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

Функции

PIXpixRankFilter (PIX *pixs, l_int32 wf, l_int32 hf, l_float32 rank)
PIXpixRankFilterRGB (PIX *pixs, l_int32 wf, l_int32 hf, l_float32 rank)
PIXpixRankFilterGray (PIX *pixs, l_int32 wf, l_int32 hf, l_float32 rank)
PIXpixMedianFilter (PIX *pixs, l_int32 wf, l_int32 hf)

Функции

PIX* pixMedianFilter ( PIX pixs,
l_int32  wf,
l_int32  hf 
)

pixMedianFilter()

Input: pixs (8 or 32 bpp; no colormap) wf, hf (width and height of filter; each is >= 1) Return: pixd (of median values), or null on error

PIX* pixRankFilter ( PIX pixs,
l_int32  wf,
l_int32  hf,
l_float32  rank 
)

pixRankFilter()

Input: pixs (8 or 32 bpp; no colormap) wf, hf (width and height of filter; each is >= 1) rank (in [0.0 ... 1.0]) Return: pixd (of rank values), or null on error

Notes: (1) This defines, for each pixel in pixs, a neighborhood of pixels given by a rectangle "centered" on the pixel. This set of wf*hf pixels has a distribution of values. For each component, if the values are sorted in increasing order, we choose the component such that rank*(wf*hf-1) pixels have a lower or equal value and (1-rank)*(wf*hf-1) pixels have an equal or greater value. (2) See notes in pixRankFilterGray() for further details.

PIX* pixRankFilterGray ( PIX pixs,
l_int32  wf,
l_int32  hf,
l_float32  rank 
)

pixRankFilterGray()

Input: pixs (8 bpp; no colormap) wf, hf (width and height of filter; each is >= 1) rank (in [0.0 ... 1.0]) Return: pixd (of rank values), or null on error

Notes: (1) This defines, for each pixel in pixs, a neighborhood of pixels given by a rectangle "centered" on the pixel. This set of wf*hf pixels has a distribution of values, and if they are sorted in increasing order, we choose the pixel such that rank*(wf*hf-1) pixels have a lower or equal value and (1-rank)*(wf*hf-1) pixels have an equal or greater value. (2) By this definition, the rank = 0.0 pixel has the lowest value, and the rank = 1.0 pixel has the highest value. (3) We add mirrored boundary pixels to avoid boundary effects, and put the filter center at (0, 0). (4) This dispatches to grayscale erosion or dilation if the filter dimensions are odd and the rank is 0.0 or 1.0, rsp. (5) Returns a copy if both wf and hf are 1. (6) Uses row-major or column-major incremental updates to the histograms depending on whether hf > wf or hv <= wf, rsp.

PIX* pixRankFilterRGB ( PIX pixs,
l_int32  wf,
l_int32  hf,
l_float32  rank 
)

pixRankFilterRGB()

Input: pixs (32 bpp) wf, hf (width and height of filter; each is >= 1) rank (in [0.0 ... 1.0]) Return: pixd (of rank values), or null on error

Notes: (1) This defines, for each pixel in pixs, a neighborhood of pixels given by a rectangle "centered" on the pixel. This set of wf*hf pixels has a distribution of values. For each component, if the values are sorted in increasing order, we choose the component such that rank*(wf*hf-1) pixels have a lower or equal value and (1-rank)*(wf*hf-1) pixels have an equal or greater value. (2) Apply gray rank filtering to each component independently. (3) See notes in pixRankFilterGray() for further details.


Документация по Leptonica. Последние изменения: Fri Aug 7 20:31:38 2009. Создано системой  doxygen 1.5.9