Giter Site home page Giter Site logo

pdwt's Introduction

DOI

Parallel DWT

PDWT is a parallel implementation of the Discrete Wavelet Transform (DWT). This implementation in CUDA targets Nvidia GPUs.

PDWT primarily aims at being fast, simple and versatile for an easy integration in a bigger project. For example, the easy interface and thresholding functions make it interesting for sparse regularization of inverse problems.

Features

  • 1D and 2D transform and their inverses, multi-levels, arbitrary sizes
  • Support of batched 1D transform
  • Separable and non-separable transforms
  • DWT and SWT, both in separable/nonseparable mode
  • 72 available separable wavelets
  • Custom wavelets can be defined
  • Thresholding and norms utilities
  • Random shift utility for translation-invariant denoising
  • Simple interface (see examples)
  • Python binding available
  • Results compatible with Matlab wavelet toolbox / Python pywt
  • Library can be compiled to work on single (float32) or double (float64) precision.

All the transforms are computed with the periodic boundary extension (the dimensions are halved at each scale, except for SWT).

Current limitations

  • 3D is not handled at the moment.
  • Only the periodic boundary extension is implemented.
  • The parallel part is implemented in CUDA, so only Nvidia GPUs can be used.

Installation

Dependencies

You need the NVIDIA CUDA Toolkit, and of course a NVIDIA GPU.

Compilation

The Makefile should build smoothly the example :

make demo

Getting started

Running the example

To run the test, you need a raw image in 32 bits floating point precision format. As PDWT was primarily written for data crunching, the I/O part is not addressed: the input and output of PDWT are float (or double, if compiled accordingly with make libpdwtd.so) arrays.

If you have python and scipy installed, you can generate an image input file with

cd test
python generate_image.py [Nr] [Nc]

where Nr, Nc are optional arguments which are the number of rows/columns of the generated image (default is 512).

You can then run an example with

make demo
./demo

and tune the wavelet, number of levels, etc. in the prompt.

Calling PDWT

A typical usage would be the following :

#include "wt.h"

// ...
// float* img = ...
int Nr = 1080; // number of rows of the image
int Nc = 1280; // number of columns of the image
int nlevels = 3;

// Compute the wavelets coefficients with the "Daubechies 7" wavelet
Wavelets W(img, Nr, Nc, "db7", nlevels);
W.forward();

// Do some thresholding on the wavelets coefficients
float norm1 = W1.norm1();
printf("Before threshold : L1 = %e\n", norm1);
W.soft_threshold(10.0);
norm1 = W1.norm1();
printf("After threshold : L1 = %e\n", norm1);

// Inverse the DWT and retrieve the image from the GPU
W.inverse();
W.get_image(img);

Citing

If you use this software, you can cite it through the following Zenodo DOI:

DOI

pdwt's People

Contributors

pierrepaleo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.