Skip to main content

The Survival Probability Adapted Nuclear Norm Shrinkage Denoiser

Project description

The Survival Probability Adapted Nuclear Norm Shrinkage (SPANNS) Denoiser

A simple denoiser compatible with VapourSynth.

Supported Formats

The denoiser core supports any 2D numeric matrices. For VapourSynth usage, you need to provide clips with full precision and planes of the same dimensions (e.g., convert YUV422 to YUV444PS or RGBS first).

Usage

spanns.spanns(clip, ...)

Arguments:

  • clip (vs.VideoNode): The original video node.
  • sigma (int): Denoising strength. Default is 1.
  • tol (float): Noise tolerance in the range [0, 1]. Default is 0.7.
  • gamma (float): Texture threshold in the range [0, 1]. Higher values preserve less texture. Default is 0.5.
  • passes (int): Number of denoising steps. Default is 2.
  • ref1 (vs.VideoNode): Reference clip, an approximation of the result. Default is a median filter.
  • ref2 (vs.VideoNode): Reference clip, a blurred one obtained from the original. It serves as an alternative way to control denoising strength. If provided, sigma will be ignored. Default is a box blur with radius equal to sigma.
  • planes (Sequence[int]): Indices of planes to process. Default is [0, 1, 2].

Returns:

The denoised clip (vs.VideoNode).

TODO

  • Implement GPU acceleration.

Background

In 2019, the author was disappointed by the practical performance of WNNM, a well-regarded but (f******)cumbersome denoising approach proposed years earlier. Although there have been improvements to the technique, most rely on patch matching and increasing complexity, which the author finds unappealing. Reflecting on its limitations, the author implemented a better (but still sh*t) heuristic method: SPANN.

In essence, SPANN damps the orthogonal components according to the noise's survival probability along the axis of component magnitude (the singular values). While the denoising results might not stand out in today's advanced landscape, the author hopes someone can appreciate its simplicity.

Buy Me Coffee

Don't, I can't have coffee.

Project details


Download files

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

Source Distribution

spanns-1.0.3.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

spanns-1.0.3-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file spanns-1.0.3.tar.gz.

File metadata

  • Download URL: spanns-1.0.3.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for spanns-1.0.3.tar.gz
Algorithm Hash digest
SHA256 9db1fe46c64539a637ca5104dfd6fa30f9ac398bd361b65ff3f95db63f81a056
MD5 5246d5e2404088d81fd13cea5f2f5c38
BLAKE2b-256 14fe1cd6b3cd211a5af6079a70280bf5ea54ffd259b20bf7924be760ee364f31

See more details on using hashes here.

File details

Details for the file spanns-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: spanns-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for spanns-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d68afb77c2c1dc28abae7ed900fe045d4cdb00f08bad312de8b45a9ab15006a6
MD5 f0783b9c6800f5ddf6778a21a6c20832
BLAKE2b-256 1afd7f0652955dff79dfa37d96d6d8d09c58c2681c4821ee33d71dc7d35cee8a

See more details on using hashes here.

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