components.noisereduce.medianfilter

class MedianFilter(config={}, **kwds)[source]

Bases: Transformer

Median filter image denoising.

RGB inputs are converted to “YUV” (Actually YCbCr) so different filter sizes can be used on luminance and chrominance. The matrix config item chooses the matrix coefficient set. It can be '601' (”Rec. 601”, standard definition) or '709' (”Rec. 709”, high definition). In 'auto' mode the matrix is chosen according to the number of lines in the image.

WARNING: this component assumes the RGB input has black level 0 and white level 255, not the 16..235 range specified in Rec 601/709. See pyctools.components.colourspace.levels for components to convert the RGB input and output.

The filter used is OpenCV’s medianBlur. For radius values greater than two the image data is converted to 8-bit. Hence the filter is best used on “gamma-corrected” images rather than linear.

Config:

radius_Y

int

Luminance filter size.

radius_UV

int

Chrominance filter size.

matrix

str

RGB<->YUV matrix.


Comments or questions? Please email jim@jim-easterbrook.me.uk.