Your company here — click to reach over 10,000 unique daily visitors

unu-cmedian - Man Page

cheap histogram-based median/mode filtering


unu cmedian -r,--radius <radius> [-mode] [-b,--bins <num>] [-w,--weight <weight>] [-p,--pad] [-c,--channel] [-i,--input <nin>] [-o,--output <nout>]


Cheap histogram-based median/mode filtering. Only works on 1, 2, or 3 dimensions. The window over which filtering is done is always square, and only a simplistic weighting scheme is available. The method is cheap because it does the median or mode based on a histogram, which enforces a quantization to the number of bins in the histogram, which probably means a loss of precision for anything except 8-bit data. Also, integral values can be recovered exactly only when the number of bins is exactly min-max+1 (as reported by unu-minmax(1)).


-r <radius> , --radius <radius>

how big a window to filter over. “-r 1” leads to a 3x3 window in an image, and a 3x3x3 window in a volume (unsigned int)


By default, median filtering is done. Using this option enables mode filtering, in which the most common value is used as output

-b <num> , --bins <num>

# of bins in histogram. It is in your interest to minimize this number, since big histograms mean slower execution times. 8-bit data needs at most 256 bins. (unsigned int); default: “256

-w <weight> , --weight <weight>

How much higher to preferentially weight samples that are closer to the center of the window. “1.0” weight means that all samples are uniformly weighted over the window, which facilitates a simple speed-up. (float); default: “1.0

-p , --pad

Pad the input (with boundary method “bleed”), and crop the output, so as to overcome our cheapness and correctly handle the border. Obviously, this takes more memory.

-c , --channel

Slice the input along axis 0, run filtering on all slices, and join the results back together. This is the way you’d want to process color (multi-channel) images or volumes.

-i <nin> , --input <nin>

input nrrd

-o <nout> , --output <nout>

output nrrd (string); default: “-

See Also

unu(1), unu-minmax(1)

Referenced By


May 2021