denoise ¶
Functions:
-
smooth_dering
–Applies deringing by using a smart smoother near edges (where ringing
-
vine_dehalo
–Dehalo via non-local errors filtering.
smooth_dering ¶
smooth_dering(
clip: VideoNode,
smooth: VideoNode | Prefilter = MINBLUR(radius=1),
ringmask: VideoNode | None = None,
mrad: int = 1,
msmooth: int = 1,
minp: int = 1,
mthr: float = 0.24,
incedge: bool = False,
thr: int = 12,
elast: float = 2.0,
darkthr: int | None = None,
contra: int | float | bool = 1.2,
drrep: int = 13,
pre_ss: float = 1.0,
pre_supersampler: ScalerT = Nnedi3(0, field=0, shifter=NoShift),
pre_downscaler: ScalerT = Point,
planes: PlanesT = 0,
show_mask: bool = False,
) -> VideoNode
Applies deringing by using a smart smoother near edges (where ringing occurs) only. Formerly known as HQDeringmod.
Parameters:
-
clip
¶VideoNode
) –Clip to process.
-
smooth
¶VideoNode | Prefilter
, default:MINBLUR(radius=1)
) –Already smoothed clip, or a Prefilter, tuple for [luma, chroma] prefilter.
-
ringmask
¶VideoNode | None
, default:None
) –Custom ringing mask.
-
mrad
¶int
, default:1
) –Expanding iterations of edge mask, higher value means more aggressive processing.
-
msmooth
¶int
, default:1
) –Inflating iterations of edge mask, higher value means smoother edges of mask.
-
minp
¶int
, default:1
) –Inpanding iterations of prewitt edge mask, higher value means more aggressive processing.
-
mthr
¶float
, default:0.24
) –Threshold of prewitt edge mask, lower value means more aggressive processing but for strong ringing, lower value will treat some ringing as edge, which "protects" this ringing from being processed.
-
incedge
¶bool
, default:False
) –Whether to include edge in ring mask, by default ring mask only include area near edges.
-
thr
¶int
, default:12
) –Threshold (8-bit scale) to limit filtering diff. Smaller thr will result in more pixels being taken from processed clip. Larger thr will result in less pixels being taken from input clip. PDiff: pixel value diff between processed clip and input clip ODiff: pixel value diff between output clip and input clip PDiff, thr and elast is used to calculate ODiff: ODiff = PDiff when [PDiff <= thr] ODiff gradually smooths from thr to 0 when [thr <= PDiff <= thr * elast] For elast>2.0, ODiff reaches maximum when [PDiff == thr * elast / 2] ODiff = 0 when [PDiff >= thr * elast]
-
elast
¶float
, default:2.0
) –Elasticity of the soft threshold. Larger "elast" will result in more pixels being blended from.
-
darkthr
¶int | None
, default:None
) –Threshold (8-bit scale) for darker area near edges, for filtering diff that brightening the image by default equals to thr/4. Set it lower if you think de-ringing destroys too much lines, etc. When darkthr is not equal to
thr
,thr
limits darkening, whiledarkthr
limits brightening. This is useful to limit the overshoot/undershoot/blurring introduced in deringing. Examples:thr=0
,darkthr=0
: no limitingthr=255
,darkthr=255
: no limitingthr=8
,darkthr=2
: limit darkening with 8, brightening is limited to 2thr=8
,darkthr=0
: limit darkening with 8, brightening is limited to 0thr=255
,darkthr=0
: limit darkening with 255, brightening is limited to 0 For the last two examples, output will remain unchanged. (0/255: no limiting) -
contra
¶int | float | bool
, default:1.2
) –Whether to use contra-sharpening to resharp deringed clip: False: no contrasharpening True: auto radius for contrasharpening int 1-3: represents radius for contrasharpening float: represents level for contrasharpening_dehalo
-
drrep
¶int
, default:13
) –Use repair for details retention, recommended values are 13/12/1.
-
planes
¶PlanesT
, default:0
) –Planes to be processed.
-
show_mask
¶bool
, default:False
) –Show the computed ringing mask.
Returns:
-
VideoNode
–Deringed clip.
Source code
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
|
vine_dehalo ¶
vine_dehalo(
clip: VideoNode,
strength: float | Sequence[float] = 16.0,
sharp: float = 0.5,
sigma: float | list[float] = 1.0,
supersampler: ScalerT = Nnedi3,
downscaler: ScalerT = Catrom,
planes: PlanesT = 0,
**kwargs: Any
) -> VideoNode
Dehalo via non-local errors filtering.
Parameters:
-
clip
¶VideoNode
) –Clip to process.
-
strength
¶float | Sequence[float]
, default:16.0
) –Strength of nl_means filtering.
-
sharp
¶float
, default:0.5
) –Weight to blend supersampled clip.
-
sigma
¶float | list[float]
, default:1.0
) –Gaussian sigma for filtering cutoff.
-
supersampler
¶ScalerT
, default:Nnedi3
) –Scaler used for supersampling before dehaloing.
-
downscaler
¶ScalerT
, default:Catrom
) –Scaler used for downscaling after supersampling.
-
planes
¶PlanesT
, default:0
) –Planes to be processed.
-
kwargs
¶Any
, default:{}
) –Additional kwargs to be passed to nl_means.
Returns:
-
VideoNode
–Dehaloed clip.
Source code
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
|