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-3-py3-none-win_amd64.whl (2.4 MB view details)

Uploaded Python 3Windows x86-64

vapoursynth_wnnm-3-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-3-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-3-py3-none-win_amd64.whl.

File metadata

  • Download URL: vapoursynth_wnnm-3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vapoursynth_wnnm-3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 0698b4b830f6fdd9a8719c768df3cbe8ea19505785b797c0451e9423dcc49c6c
MD5 f6c054fdb94a220537e6d62211773c89
BLAKE2b-256 3f896bdd44d0b19d012b144b1c1407dbd024b01c5fb57dcea471076a7d241dfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_wnnm-3-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-3-py3-none-manylinux_2_38_aarch64.manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for vapoursynth_wnnm-3-py3-none-manylinux_2_38_aarch64.manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 a2f87bd3fdac6d623b23fa17cd45a299143b0c3281625eaded9b5c7c45862f7c
MD5 ac17d9d05c0c2560ff54224c3ed6736b
BLAKE2b-256 560782bec54cd3d4a8af1f552be2e23a35394b3d304eb3235adc66152a6801ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_wnnm-3-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-3-py3-none-manylinux_2_34_x86_64.manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for vapoursynth_wnnm-3-py3-none-manylinux_2_34_x86_64.manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 77a617d0d6f518e896ae7a7462113adcaf213cec79b09770e611d45d55b76ae6
MD5 8332edb3fe8d69a9df8e83b834ac227a
BLAKE2b-256 2d8df73d37b54ccd0c8a8f8e29b2656ed0ec11a34ea59bf80c016bec53fb27aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_wnnm-3-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