pyACT is a Python implementation of adaptive curvelet thresholding (ACT) for denoising images corrupted by additive stationary Gaussian noise, including both white and colored noise models.
The repository includes:
- A curvelet-domain denoising pipeline in
src/denoising.py - A wrapping-based discrete curvelet transform in
src/curvelet.py - A runnable demo with synthetic noise generation in
tests/demo.py - Bundled sample images in
test_images
For the original MATLAB reference implementation, see NEslahi/ACT.
Install the project in editable mode:
python3 -m pip install -e .Current runtime dependencies:
numpyscipypillowmatplotlib
pyACT/
├── src/
│ ├── __init__.py
│ ├── curvelet.py
│ └── denoising.py
├── test_images/
│ └── *.tif
├── tests/
│ ├── demo.py
│ └── utils.py
├── LICENSE
├── pyproject.toml
└── README.md
The main denoising entry point is act_filter:
import numpy as np
from PIL import Image
from denoising import act_filter
image = np.asarray(Image.open("test_images/Barbara256.tif"), dtype=np.float64) / 255.0
rng = np.random.default_rng(0)
noise_std = 0.02
noisy = image + noise_std * rng.standard_normal(image.shape)
denoised = act_filter(noisy, noise_var=noise_std**2, threshold_setting="s")noisy_img: 2-D noisy image arraynoise_var: optional scalar variance for white Gaussian noise, or a 2-D FFT power spectral density array for colored noisethreshold_setting: thresholding mode, one of"s","h", or"ksigma"
If noise_var is omitted, the method estimates the noise level internally from the highest-frequency curvelet subband.
Additional public functions exported by the package are:
adaptive_curvelet_thresholdingcompute_dcut_root_psdml_estimatorfdct_wrappingifdct_wrapping
Run the demo script with:
python3 tests/demo.py --seed 0 --save-figure --save-to-matWhat the demo does:
- Selects a bundled test image, or uses
--imageif provided - Synthesizes stationary white or colored Gaussian noise
- Runs both
ksigmathresholding and ACT soft-thresholding - Reports PSNR values in the terminal
- Saves
.pngand optional.matoutputs totests/results(created automatically if needed)
Useful CLI options:
--image PATH--seed INT--save-figure--output PATH--save-to-mat--mat-output PATH
When default output paths are used, saved filenames include the source image name, the generated kernel type, and the kernel power.
- Input images are handled as
float64arrays. - Color images loaded by the demo are converted to grayscale before denoising.
- Colored-noise support is based on supplying the noise FFT-PSD to
act_filter.
- N. Eslahi and A. Aghagolzadeh, "Compressive Sensing Image Restoration Using Adaptive Curvelet Thresholding and Nonlocal Sparse Regularization," IEEE Transactions on Image Processing, vol. 25, no. 7, pp. 3126-3140, 2016. https://doi.org/10.1109/TIP.2016.2562563
- E. Candès, L. Demanet, D. Donoho, and X. Ying, "Fast discrete curvelet transforms," Multiscale Modeling and Simulation, vol. 5, no. 3, pp. 861-899, 2006.
- J. L. Starck, E. J. Candès, and D. L. Donoho, "The curvelet transform for image denoising," IEEE Transactions on Image Processing, vol. 11, no. 6, pp. 670-684, 2002.
See LICENSE for the license distributed with this repository. If you rely on the upstream ACT work or related external sources, review their original licensing terms as well.
If you find this code is useful in your research, please consider to cite:
@article{eslahi2016compressive,
title={Compressive sensing image restoration using adaptive curvelet thresholding and nonlocal sparse regularization},
author={Eslahi, Nasser and Aghagolzadeh, Ali},
journal={IEEE Transactions on Image Processing},
volume={25},
number={7},
pages={3126--3140},
year={2016},
publisher={IEEE}
}