Skip to main content

Weighted Nuclear Norm Minimization Denoiser for VapourSynth

Project description

VapourSynth-WNNM

Weighted Nuclear Norm Minimization Denoiser for VapourSynth.

Description

WNNM is a denoising algorithm based on block-matching and weighted nuclear norm minimization.

Block matching, which is popularized by BM3D, finds similar blocks and then stacks together in a 3-D group. The similarity between these blocks allows details to be preserved during denoising.

In contrast to BM3D, which denoises the 3-D group based on frequency domain filtering, WNNM utilizes weighted nuclear norm minimization, a kind of low rank matrix approximation. Because of this, WNNM exhibits less blocking and ringing artifact compared to BM3D, but the computational complexity is much higher. This stage is called collaborative filtering in BM3D.

Usage

Prototype:

core.wnnm.WNNM(clip clip[, float[] sigma = 3.0, int block_size = 8, int block_step = 8, int group_size = 8, int bm_range = 7, int radius = 0, int ps_num = 2, int ps_range = 4, bool residual = false, bool adaptive_aggregation = true, clip rclip = None])

  • clip:

    The input clip. Must be of 32 bit float format. Each plane is denoised separately.

  • sigma:

    Denoising strength of each plane.

  • block_size, block_step, group_size, bm_range, radius, ps_num, ps_range:

    Same as those in VapourSynth-BM3D.

  • residual:

    Whether to center blocks before collaborative filtering. Default: False.

  • adaptive_aggregation:

    Whether to aggregate blocks adaptively. Default: True.

  • rclip:

    Reference clip for block matching. Must be of the same dimensions and format as clip.

Implementation

Default values of block_size, block_step, group_size are modified for acceleration.

For spatial denoising, the block-matching implemented is the same as the official implementation, which is similar to that of BM3D without setting a threshold on whether dissimilar blocks should be included in the 3-D group. This is the same strategy implemented in VapourSynth-BM3DCUDA but not in VapourSynth-BM3D.

For temporal denoising, this implementation utilizes the same predictive search proposed by V-BM3D, which is closer to VapourSynth-BM3D (without dissimilar block thresholding) than VapourSynth-BM3DCUDA. The later one implemented a modified temporal predictive search that may finds multiple instances of the same similar block for acceleration.

During collaborative filtering, the official WNNM implementation centers blocks in the 3-D group. This is controlled by the residual parameter and is off by default. The major singular value is untouched when residual is off.

Note: Because of WNNM and the modification, the maximum denoising effect achieved is the best rank-one approximation of the 3-D group when residual is off, or the mean of the group when residual is on, which may not be enough for strong noises. The official implementation uses iterative regularization, which can be easily implemented as

for i in range(num_iterations):
    if i == 0:
        previous = source
    elif i == 1:
        previous = denoised
    else:
        previous = core.std.Expr([source, previous, denoised], "x y - {factor} * z +".format(factor=0.1))
    denoised = WNNM(previous)
# output: `denoised`

The similar blocks are weightedly aggregated by the inverse of the number of non-zero singular values after WNNM, inspired by BM3D. This is controlled by the adaptive_aggregation parameter and is on by default.

The block-matching can be guided by an oracle reference clip rclip in the same manner as ref for BM3D. The collaborative filtering is not guided, unlike BM3D.

Compilation

  • On x86_64, oneMKL is required. Vector class library is also required when compiling with AVX2.

    cmake -S . -B build -D CMAKE_BUILD_TYPE=Release \
    -D MKL_LINK=static -D MKL_THREADING=sequential -D MKL_INTERFACE=lp64
    
    cmake --build build
    
    cmake --install build
    
  • On Aarch64, ArmPL is required.

Example build process can be found in workflows.

Reference

  1. S. Gu, L. Zhang, W. Zuo and X. Feng, "Weighted Nuclear Norm Minimization with Application to Image Denoising," 2014 IEEE Conference on Computer Vision and Pattern Recognition, 2014, pp. 2862-2869.

  2. K. Dabov, A. Foi, V. Katkovnik and K. Egiazarian, "Image Denoising by Sparse 3-D Transform-Domain Collaborative Filtering," in IEEE Transactions on Image Processing, vol. 16, no. 8, pp. 2080-2095, Aug. 2007.

  3. K. Dabov, A. Foi and K. Egiazarian, "Video denoising by sparse 3D transform-domain collaborative filtering," 2007 15th European Signal Processing Conference, 2007, pp. 145-149.

  4. Official implementation

  5. VapourSynth-BM3D

  6. VapourSynth-BM3DCUDA

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vapoursynth_wnnm-3rc1-py3-none-win_amd64.whl (2.4 MB view details)

Uploaded Python 3Windows x86-64

vapoursynth_wnnm-3rc1-py3-none-manylinux_2_38_aarch64.manylinux_2_39_aarch64.whl (83.3 MB view details)

Uploaded Python 3manylinux: glibc 2.38+ ARM64manylinux: glibc 2.39+ ARM64

vapoursynth_wnnm-3rc1-py3-none-manylinux_2_34_x86_64.manylinux_2_39_x86_64.whl (1.7 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64manylinux: glibc 2.39+ x86-64

File details

Details for the file vapoursynth_wnnm-3rc1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for vapoursynth_wnnm-3rc1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d7691101e08699a53966d6efdfbf4db5f880ac44a27e704dda99d4cb4302d3a9
MD5 b4c7e82c1fb8d9ca46787cba054bf13f
BLAKE2b-256 3160ce0322450f39eab43430574d29a444efd75845fa093f01525681c6e412b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_wnnm-3rc1-py3-none-win_amd64.whl:

Publisher: publish.yml on AmusementClub/VapourSynth-WNNM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_wnnm-3rc1-py3-none-manylinux_2_38_aarch64.manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for vapoursynth_wnnm-3rc1-py3-none-manylinux_2_38_aarch64.manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 5e3386bc130ff6d5d7860179272fdc4f5178a3042dcd10311506c7ab1684c9a8
MD5 30a12140fb6660990316953671c952a0
BLAKE2b-256 2f749bdff9b631c6395bb5508180600e7430ba5ddbb02c1386ebe28209cb68a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_wnnm-3rc1-py3-none-manylinux_2_38_aarch64.manylinux_2_39_aarch64.whl:

Publisher: publish.yml on AmusementClub/VapourSynth-WNNM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_wnnm-3rc1-py3-none-manylinux_2_34_x86_64.manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for vapoursynth_wnnm-3rc1-py3-none-manylinux_2_34_x86_64.manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 32f5ae71c8e57c3737b7d5aa0414ff2a5c92fdc8295890f8dbab8e3b3699692b
MD5 24d20703279bd3476a0c95832b7e7f5d
BLAKE2b-256 9b5fa6950a40f2affa49d91fe4067e6f0058ca627dcc347f1204854d6c1bbc5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_wnnm-3rc1-py3-none-manylinux_2_34_x86_64.manylinux_2_39_x86_64.whl:

Publisher: publish.yml on AmusementClub/VapourSynth-WNNM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page