VarianSlim


Author V. C. Mohan
Date Nov 19, 2006
EMail: mohanvc

VarianSlim plugin for Avisynth 2.5 version, is free and the author does not give any guarentee for its operation. It may be downloaded and used at the users risk.

This is an adaptive local noise reduction filter that uses image value statistics in a moving grid while trying to preserve sharpness of image.

From a specified frame of the clip VarianSlim either auto selects a suitable window or uses user specified window to obtain noise parameterss, and their variation for each iteration till it meets the specified limit. Incase of RGB the green color and in case of Y-U-V formats, the Y plane is used for autoselection of window

Parameter ry, gu, by control whether a color is to be left out or processed, if so with what accent. A value of zero will leave out that color ( or luma or chroma). A value of one will use derived values. Any higher value may accentuate. Accentuation may soften the image so may be used cautiously.

Parameter limit is for stopping iteration if improvement is less than this %age over previous iteration results. This is determined separately for each color.

This plugin works in YUY2, YV12, RGB32 and RGB24 color spaces. Results of using rgb format may be slightly different to that of Y - U - V formats.

The window for deriving noise parameters, if autow is set to false, must be located in an area with least image grey level variations, so that noise statistics are correctly estimated. Note that this window coordinates must be specified as default values are not provided. If window is located in an improper part , then it can lead to heavy blurring. A minimum of 1024 pixels window be specified.

Due to use of grid a border of half value of grid around the frame will be left out unprocessed.


Details of parameters
Description Name Type Limits Default
Input clip clip none
frame number from which noise statistics to be determined nf integer within clip 0
Number of pixels along x axis in moving grid xgrid integer 3 to 11 5
Number of pixels along y axis in moving grid ygrid integer 3 to 11 xgrid
Whether window to be selected automatically autow boolean true for yes, false for use user specified window true
minimum window size if autow is true minw integer Between 1/128 and 1/16 of frame size 1/64 of frame size
limiting %age of improvement per iteration limit integer Between 0 and 20 2
accent for red or Y ry integer Between 1 to 500 1
accent for green or U gu integer Between 1 to 500 1
accent for blue or V bv integer Between 1 to 500 1
window left x at start frame for computing global variance lx integer within clip, less than rx none. Must be specified for autow being false
window top y at start frame for computing global variance ty integer within clip, less than by none. Must be specified for autow being false
window right x at start frame for computing global variance rx integer within clip, more than lx none. Must be specified for autow being false
window bottom y at start frame for computing global variance by integer within clip, more than ty none. Must be specified for autow being false

Usage examples
varianslim()
varianslim(uv = false, limit = 1 ,autow = false, xgrid = 7, lx = 100, rx = 220, ty = 340, by = 400)
following script used to get the images below:
On top is input, below is output using script
varianslim(uv = true, ry=2, gu = 2, bv = 2, limit = 1 ,autow = true, xgrid = 5, minw = 12000)
input:-

output:-

To my index page ................................ To Avisynth