#wavelet #image #analysis #atrous #multiscale

bin+lib image-dwt

An implementation of the À Trous Discrete Wavelet Transform for images

7 releases

new 0.3.3 Apr 28, 2024
0.3.2 Apr 8, 2024
0.3.0 Mar 26, 2024
0.2.2 Mar 26, 2024
0.1.0 Mar 20, 2024

#153 in Multimedia

Download history 322/week @ 2024-03-18 213/week @ 2024-03-25 15/week @ 2024-04-01 242/week @ 2024-04-08 6/week @ 2024-04-15

590 downloads per month
Used in 2 crates (via stardetect)

Apache-2.0

24KB
553 lines

À Trous Discrete Wavelet Transform (DWT) for image-rs

This project provides an implementation of the À Trous Discrete Wavelet Transform (DWT) algorithm for images. The À Trous DWT is a technique used for signal and image processing, particularly for tasks such as denoising, compression, and feature extraction.

Overview

The À Trous DWT is a variation of the Discrete Wavelet Transform (DWT) that involves convolution with a filter bank. It decomposes an image into different frequency sub-bands, allowing for analysis at multiple resolutions. This implementation supports both forward and inverse transforms.

Why

I'm trying to build a suite of tools in rust that facilitate image processing, primarily deep sky images and data. Wavelet transform and multi-resolution analysis is a very widely used transform in these cases.

Usage

fn remove_large_scale_structures() {
    let image = image::open("./sample.jpg").unwrap();
    let transform = ATrousTransform::new(&image, 6, B3SplineKernel);

    let recomposed = transform
        .into_iter()
        // Skip pixel scale 0 layer for noise removal
        .skip(1)
        // Only take layers where pixel scale is less than 2
        .filter(|item| item.pixel_scale.is_some_and(|scale| scale < 2))
        // Recompose processed layers into final image
        .recompose_into_image(image.width() as usize, image.height() as usize);

    recomposed.to_rgb8().save("recombined.jpg").unwrap()
}

Installation

To use this library in your Rust project, add the following to your Cargo.toml file:

[dependencies]
image_dwt = "0.3.2"

Dependencies

~15MB
~90K SLoC