Repository navigation
BM3D
Block-matching and 3D filtering (BM3D) denoiser on the CPU, ported from the CUDA BM3D in vszipcu (itself a port of BM3DCUDA). It takes the same arguments as their BM3D, minus the GPU ones. The output is close to the GPU's but isn't guaranteed bit-identical (see Differences).
Signature (argument order and defaults):
vszip.BM3D(vnode clip[, vnode ref=None, float[] sigma=3.0, int[] block_step=8, int[] bm_range=9, int radius=0, int[] ps_num=2, int[] ps_range=4, int chroma=0, string[] bm_error_s="ssd", string[] transform_2d_s="dct", string[] transform_1d_s="dct"])
src = clip.resize.Bicubic(format=vs.YUV444PS)
basic = src.vszip.BM3D(sigma=3.0, radius=1)
final = src.vszip.BM3D(ref=basic, sigma=3.0, radius=1)-
clip:
Input clip: constant-format Gray, YUV or RGB, 32-bit float. Each processed plane must be at least 8x8. -
ref (clip):
Basic estimate for the final (Wiener) step, usually the output of a firstBM3Dcall. Matching runs on it. Must matchclip's format, size and length. -
sigma (float[], default: 3.0, range: >= 0):
Denoising strength per plane; missing values repeat the last one. A plane withsigma0 is copied, and with everysigma0 the clip is returned unchanged. -
block_step (int[], default: 8, range: 1..8):
Step between reference blocks. Smaller is better and slower. -
bm_range (int[], default: 9, range: >= 1):
Search radius for similar blocks in the current frame. Larger is slower. -
radius (int, default: 0, range: 0..16):
Temporal radius: framesn - radiuston + radiusare searched.0is spatial only. The temporal result is aggregated inside the filter, so the returned clip is already the denoised one. -
ps_num (int[], default: 2, range: 1..8):
Withradius > 0: how many of the best matches seed the search in the neighbouring frames. -
ps_range (int[], default: 4, range: >= 1):
Withradius > 0: search radius around each seed in the neighbouring frames. -
chroma (int, default: 0):
1is CBM3D: U and V reuse the block matching of Y. Needs YUV 4:4:4. -
bm_error_s (string[], default:
"ssd"):
Block distance:"ssd","sad","zssd","zsad"or"ssd/norm". -
transform_2d_s, transform_1d_s (string[], default:
"dct"):
Transforms of the blocks and of the group:"dct","haar","wht"or"bior1.5".
- One function:
radius > 0returns the final clip directly, so there is no stacked clip, noBM3Dv2, noVAggregateand nozero_init. - No
extractor_exp: on the GPU it only makes the output repeatable, and the CPU output always is. - Not bit-identical with the GPU: its fast-math reciprocal and divide aren't reproduced. The mean difference is about 4e-8.