Skip to main content

Python Wavelet Imaging

Project description

https://travis-ci.org/jeremiedecock/pywi.svg?branch=master

PyWI - Python Wavelet Imaging

Copyright (c) 2016-2018 Jeremie DECOCK (www.jdhp.org)

Description

PyWI is a Python image filtering library aimed at removing additive background noise from raster graphics images.

  • Input: an image file containing the raster graphics to clean (i.e. an image defined as a classic rectangular lattice of square pixels).

  • Output: an image file containing the cleaned raster graphics.

The image filter relies on multiresolution analysis methods (Wavelet transforms) that remove some scales (frequencies) locally in space. These methods are particularly efficient when signal and noise are located at different scales (or frequencies). Optional features improve the SNR ratio when the (clean) signal constitute a single cluster of pixels on the image (e.g. electromagnetic showers produced with Imaging Atmospheric Cherenkov Telescopes). This library is written in Python and is based on the existing Cosmostat tools iSAp (Interactive Sparse Astronomical data analysis Packages http://www.cosmostat.org/software/isap/).

The PyWI library also contains a dedicated package to optimize the image filter parameters for a given set of images (i.e. to adapt the filter to a specific problem). From a given training set of images (containing pairs of noised and clean images) and a given performance estimator (a function that assess the image filter parameters comparing the cleaned image to the actual clean image), the optimizer can determine the optimal filtering level for each scale.

Features

The PyWI library contains:

  • wavelet transform and wavelet filtering functions for image multiresolution analysis and filtering;

  • additional filter to remove some image components (non-significant pixels clusters);

  • a set of generic filtering performance estimators (MSE, NRMSE, SSIM, PSNR, image moment’s difference), some relying on the scikit-image Python library (supplementary estimators can be easily added to meet particular needs);

  • a graphical user interface to visualize the filtering process in the wavelet transformed space;

  • an Evolution Strategies (ES) algorithm known in the mathematical optimization community for its good convergence rate on generic derivative-free continuous global optimization problems (Beyer, H. G. (2013) “The theory of evolution strategies”, Springer Science & Business Media);

  • additional tools to manage and monitor the parameter optimization.

Dependencies

PyWI has the following strict requirements:

PyWI also depends on other packages for optional features:

However, note that these only need to be installed if those particular features are needed. PyWI will import even if these dependencies are not installed.

Installation

Using pip

Most major projects upload official packages to the Python Package Index. They can be installed on most operating systems using Python standard pip package manager.

Note that you need to have Python3.x and pip already installed on your system.

On MacOSX and Gnu/Linux

You can install PyWI using the following command (in a terminal):

pip install pywi --no-deps

As an alternative, you can install PyWI from the downloaded source code:

python3 setup.py install --no-deps

If PyWI is already installed on your system you can upgrade it with this command:

pip install --upgrade pywi

To uninstall PyWI, type:

pip uninstall pywi
On Windows

You can install PyWI using the following command (in a command prompt):

py -m pip install pywi --no-deps

As an alternative, you can install PyWI from the downloaded source code:

py setup.py install --no-deps

If PyWI is already installed on your system you can upgrade it with this command:

py -m pip install --upgrade pywi

To uninstall PyWI, type:

py -m uninstall pywi

Using conda

To install this package with conda run in a terminal:

conda install -c jdhp pywi

So far, the PyWI Anaconda package is only available for MacOSX. A package for Linux and Windows will be available soon.

Cosmostat iSAP Sparce2D installation

  1. Download http://www.cosmostat.org/wp-content/uploads/2014/12/ISAP_V3.1.tgz (see http://www.cosmostat.org/software/isap/)

  2. Unzip this archive, go to the “sparse2d” directory and compile the sparse2d library. It should generate two executables named mr_transform and mr_filter:

    tar -xzvf ISAP_V3.1.tgz
    cd ISAP_V3.1/cxx
    tar -xzvf sparse2d_V1.1.tgz
    cd sparse2d
    compile the content of this directory

An automated compilation and installation script for Linux is available there (author: Tino Michael).

Example

  1. Download a sample image (e.g. archives_ngc3576.png)

  2. In your system terminal, from the directory that contains the sample image, type:

    pywi-mrtransform -t 256,256,256,0 --plot archives_ngc3576.png
    pywi-mrfilter -s 256,256,256,0 --plot archives_ngc3576.png
  3. Type pywi-mrtransform -h or pywi-mrfilter -h to display the list of available options and their documentation.

IPython/Jupyter Notebooks

PyWI provide some Jupyter notebooks that can be used as examples or tutorials.

Bug reports

To search for bugs or report them, please use the PyWI Bug Tracker at:

https://github.com/jeremiedecock/pywi/issues

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

pywi-0.3.dev12.tar.gz (520.3 kB view details)

Uploaded Source

File details

Details for the file pywi-0.3.dev12.tar.gz.

File metadata

  • Download URL: pywi-0.3.dev12.tar.gz
  • Upload date:
  • Size: 520.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for pywi-0.3.dev12.tar.gz
Algorithm Hash digest
SHA256 0b1c7e07a2bd28245a54cb9e6a914e1bbeaf2fef558437be0e731183cddabe8f
MD5 d98614ba219da3f3f9f88e96931a6ac2
BLAKE2b-256 de65302412e35dbbc39946162c2851db03840bc3b82045a55efde9328c796919

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page