Skip to main content

A trous wavelet transform and utilities

Project description

WATROO

Implements the à trous wavelet transform and associated tools: denoising, enhancement, etc.

Contents

Installation
A trous transform
Scaling functions
WOW! (Wavelets Optimized Whitening)
References

Installation

Within the active environment

pip install .

À trous transform

ATrousTransform implements a dyadic 'à-trous' transform

Scaling functions

Triangle

B3 spline

Examples

Denoise an image

import numpy as np
from watroo import AtrousTransform, Triangle

denoise_sigma = [5, 3]
transform = AtrousTransform(Triangle)
img = np.random.normal(size=(512, 512))
coefficients = transform(img, len(denoise_sigma))
# coefficients.data is an ndarray that contains the coefficients proper
coefficients.denoise(denoise_sigma)
# coeffcients accepts numpy operations
denoised = np.sum(coefficients, axis=0)
# which is equivalent to
denoised = coefficients.data.sum(axis=0)

The same result cam be obtained using the denoise convenience function

from watroo import Triangle, denoise

img = np.random.normal(size=(512, 512))
denoise_sigma = [5, 3]
denoised = denoise(img, denoise_sigma, Triangle)

Extract significant coefficients at a given scale

# return a ndarray containing the 3-sigma significance of coefficients
# at scale 2 with hard thresholding
s = coefficients.significance(3, 2, soft_threshold=False)

Compute the standard deviation of Gaussian white noise

# compute 10 scales of the 2D B3spline
w = B3spline(2)
w.compute_noise_weights(10)

This returns a 1-D ndarray containing the normalization used to estimate the significance of coefficients.

WOW! (Wavelets Optimized Whitening)

from watroo import wow
# read in your image here (must be floating point)
# ...

Standard enhancement:

wow_image, _ = wow(image)

'Bilateral' version, slower but better:

    wow_image, _ = wow(image, bilateral=1)

Denoised bilateral enhancement (best results):

wow_image, _ = wow(image, bilateral=1, denoise_coefficients=[5, 2])

References

  • Starck, J.-L. & Murtagh, F. 2002, Handbook of Astronomical Data Analysis, Springer-Verlag, doi:10.1007/978-3-540-33025-7
  • Auchère, F., Soubrié, E., Pelouze, G., Buchlin, É. 2022, Image Enhancement With Wavelets Optimized Whitening, A&A, 670, id.A66, doi:10.1051/0004-6361/202245345

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

watroo-0.0.4.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

watroo-0.0.4-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file watroo-0.0.4.tar.gz.

File metadata

  • Download URL: watroo-0.0.4.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.7

File hashes

Hashes for watroo-0.0.4.tar.gz
Algorithm Hash digest
SHA256 8348e6952cb0a6dd3d6cb6cf2ecb75f2ebacfb7abd3431e89cb1af124aba1a91
MD5 4b5247f31c3325903e0356249f220a38
BLAKE2b-256 ebf7207ca3a98f0f4234a60304c8882b3607c8e8bb0e0db226440efe71dd2d2c

See more details on using hashes here.

File details

Details for the file watroo-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: watroo-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.7

File hashes

Hashes for watroo-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 80469293bcb81ecbe270a34dd22098aff7acd11b895f8dc25df58c00d34e2ce7
MD5 b2f6252179717ad2e313325eb46a4739
BLAKE2b-256 891d8abec42c822b028ec1e6b5137bcec036bfdfdea7877a90600307db1146e9

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