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(default0.33): stronger smoothing and stripe suppression as it increases.mu2(default0.003): larger values enforce stronger stripe extraction but may affect fine structures.tiles(default1): splits image intotiles 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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f616a8608af9071c4b18f8aff48adbaac27d616daa451df3c1f34ea979bedf30
|
|
| MD5 |
509efe80b9dcf1fcfdb9b349bb711426
|
|
| BLAKE2b-256 |
fd15d8f00617c6098c89095da845b6ca75b5d852341d3c80965e559137ca9137
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f212e39e34f2d05886f1e5688571e45d33b35cdd973f1b83c38489cd23f44c7
|
|
| MD5 |
ae0b1b4b77386ebd7a4da0d7f7d2819c
|
|
| BLAKE2b-256 |
41f3444f04aaf1f91a77e6d31b566ed836a24d0f52617dc2fbc2337b8e3b3d3d
|