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: SPANNS.

In essence, SPANNS 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.1.1.tar.gz (8.2 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.1.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for spanns-1.1.1.tar.gz
Algorithm Hash digest
SHA256 39fbe9e31c41bd6c97ec4cf7720d36d5a1805f694dbcf75a9dc05c3b093fa91e
MD5 7d5e19e8877d103c3b7554e5b7ea97bd
BLAKE2b-256 f16a721ccd2db5565c8f6586d1a15eb13660a6bc3b910b249f1fd276236c4c95

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spanns-1.1.1-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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 904fc09f28072e9c465ca9e558df3e28c662d1ca7fc699e7faaaf61b051c53bf
MD5 bc8fad3047a0777fbd296b0a7d05b737
BLAKE2b-256 d1e1745bf6604e788ba2e80b00ad84b35552a51063a55893c7e31e6b3db21537

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