Skip to main content

PDHG-based universal stripe-noise removal for images, backed by PyTorch

Project description

destripe

PDHG-based universal stripe-noise removal for NumPy images ([H, W] or [H, W, 3]), backed by PyTorch (cpu/cuda).

Features

  • Removes vertical and diagonal stripe patterns.
  • Supports tiled processing for large images with smooth blending.
  • Preserves color by estimating noise from luminance.
  • Runs on CPU or CUDA devices.

Install

pip install .

For development:

python -m venv .venv
source .venv/bin/activate
pip install -e .

Quick Start

from destripe import destripe

image = ...  # numpy.ndarray, shape [H, W] or [H, W, 3]

clean = destripe(
    image,
    mu1=0.33,    # smoothing / removal strength
    mu2=0.003,   # stripe penalty (structure protection tradeoff)
    tiles=2,     # n x n grid for tiled processing
    device="cpu" # or "cuda"
)

Parameters

  • mu1 (default 0.33): stronger smoothing and stripe suppression as it increases.
  • mu2 (default 0.003): larger values enforce stronger stripe extraction but may affect fine structures.
  • tiles (default 1): splits image into tiles x tiles; useful for very large inputs.
  • device ("cpu" or "cuda"): compute target.

Suggested mu Pairs

  • Light, thin stripes: [0.17, 0.003], [0.23, 0.003]
  • Typical to strong stripes: [0.33, 0.003], [0.4, 0.007]
  • Severe corruption / short stripes: [0.5, 0.017]
  • Conservative option: [0.1, 0.0017]

These are starting points, not universal optima.

Test

pytest -q

Reference

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

destripe-0.1.0.tar.gz (854.9 kB view details)

Uploaded Source

Built Distribution

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

destripe-0.1.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file destripe-0.1.0.tar.gz.

File metadata

  • Download URL: destripe-0.1.0.tar.gz
  • Upload date:
  • Size: 854.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for destripe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f616a8608af9071c4b18f8aff48adbaac27d616daa451df3c1f34ea979bedf30
MD5 509efe80b9dcf1fcfdb9b349bb711426
BLAKE2b-256 fd15d8f00617c6098c89095da845b6ca75b5d852341d3c80965e559137ca9137

See more details on using hashes here.

File details

Details for the file destripe-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: destripe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for destripe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f212e39e34f2d05886f1e5688571e45d33b35cdd973f1b83c38489cd23f44c7
MD5 ae0b1b4b77386ebd7a4da0d7f7d2819c
BLAKE2b-256 41f3444f04aaf1f91a77e6d31b566ed836a24d0f52617dc2fbc2337b8e3b3d3d

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