Skip to main content

Python tools for multi-scale image processing, including Laplacian pyramids, Wavelets, and Steerable Pyramids.

Project description

pyrtools: tools for multi-scale image processing

PyPI Version Anaconda-Server Badge License: MIT Python version Build Status Documentation Status DOI Binder codecov

Briefly, the tools include:

  • Recursive multi-scale image decompositions (pyramids), including Laplacian pyramids, QMFs, Wavelets, and steerable pyramids. These operate on 1D or 2D signals of arbitrary dimension.
  • Fast 2D convolution routines, with subsampling and boundary-handling.
  • Fast point-operations, histograms, histogram-matching.
  • Fast synthetic image generation: sine gratings, zone plates, fractals, etc.
  • Display routines for images and pyramids. These include several auto-scaling options, rounding to integer zoom factors to avoid resampling artifacts, and useful labeling (dimensions and gray-range).

This is a python 3 port of Eero Simoncelli's matlabPyrTools, but it does not attempt to recreate all of the matlab code from matlabPyrTools. The goal is to create a Python interface for the C code at the heart of matlabPyrTools.

NOTE: If you are only interested in the complex steerable pyramid, we have a pytorch implementation in the plenoptic package; the implementation in plenoptic is differentiable.

Citing us

If you use pyrtools in a published academic article or presentation, please cite us! You can find the link to the most recent release on Zenodo here (though please specify the version you used not the most recent one!). You can also get a formatted citation at the top right of our GitHub repo

Installation

You can install pyrtools using either pip:

pip install pyrtools

or conda:

conda install pyrtools -c conda-forge

You may also install from source, directly from the git repository. This is largely useful if you are seeking to modify the code or make contributions. To do so, clone the repository and run pip install. On Mac or Linux, that looks like:

git clone https://github.com/LabForComputationalVision/pyrtools.git
cd pyrtools/
pip install .

You may also want an editable install, pip install -e ., in which case changes you make in the source code will be reflected in your install.

Pyramid resources

If you would like to learn more about pyramids and why they're helpful for image processing, here are some resources to get you started:

Usage:

  • load modules:
import pyrtools as pt
  • create pyramid:
pyr = pt.pyramids.LaplacianPyramid(img)
  • reconstruct image from pyramid:
recon_img = pyr.recon_pyr()

Please see TUTORIALS/02_pyramids.ipynb for more examples.

For developres

Testing

You can find unit tests in TESTS/unitTests.py and run them with python TESTS/unitTests.py.

Build the documentation

NOTE: If you just want to read the documentation, you do not need to do this; documentation is built automatically on readthedocs.

However, it can be built locally as well. You would do this if you've made changes locally to the documentation (or the docstrings) that you would like to examine before pushing.

# create a new virtual environment and then...
# install pyrtools with sphinx and documentation-related dependencies
pip install -e .[docs]
# build documentation
cd docs/
make html

The index page of the documentation will then be located at docs/_build/html/index.html, open it in your browser to navigate around.

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

pyrtools-1.0.6.tar.gz (7.5 MB view details)

Uploaded Source

Built Distributions

pyrtools-1.0.6-py3-none-win_amd64.whl (99.4 kB view details)

Uploaded Python 3 Windows x86-64

pyrtools-1.0.6-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (115.9 kB view details)

Uploaded Python 3 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyrtools-1.0.6-py3-none-macosx_11_0_arm64.whl (92.1 kB view details)

Uploaded Python 3 macOS 11.0+ ARM64

pyrtools-1.0.6-py3-none-macosx_10_9_x86_64.whl (95.2 kB view details)

Uploaded Python 3 macOS 10.9+ x86-64

File details

Details for the file pyrtools-1.0.6.tar.gz.

File metadata

  • Download URL: pyrtools-1.0.6.tar.gz
  • Upload date:
  • Size: 7.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for pyrtools-1.0.6.tar.gz
Algorithm Hash digest
SHA256 0abfb5a7ccac9b40c8f9cdbc15edb4bd0090c7eed01dac9e9d668ed37bc8f99f
MD5 135f6c93dbf3daacffcf0d6b604b42b9
BLAKE2b-256 05f41d7d91918292206a305627f7152be275d200325c00d03483f27978c80c79

See more details on using hashes here.

File details

Details for the file pyrtools-1.0.6-py3-none-win_amd64.whl.

File metadata

  • Download URL: pyrtools-1.0.6-py3-none-win_amd64.whl
  • Upload date:
  • Size: 99.4 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.7

File hashes

Hashes for pyrtools-1.0.6-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f28be101c92f57d33443fb1e15cb4c23d07e888ba4591fe1b2ff07ea22cae2c8
MD5 1be7a971f354dd2b8f4f6165be36a0b0
BLAKE2b-256 6b55b16c7777f6d0c63e7fa953afe166aaf018083d5fbd2d23eba7317fdbff8a

See more details on using hashes here.

File details

Details for the file pyrtools-1.0.6-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyrtools-1.0.6-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e2a9b86e51cd4f3c95a6fc561285be4a9937747465e815062b81beeb9260811
MD5 c65eb24adffa74398f964cb8176d5598
BLAKE2b-256 bcf6e54642f78c19c0a001212e2afd02e6152df31d96dbe9e61423785ddaa337

See more details on using hashes here.

File details

Details for the file pyrtools-1.0.6-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyrtools-1.0.6-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b36794babb11b663c90d43a0080266afdc5ae67984a243493f933059ea7cc915
MD5 1f2cf7b86950e56d5d037f128b8aef91
BLAKE2b-256 48df2165c518e135bc478fd9038da6283e1cd0a7be3fe6375598a692afe30188

See more details on using hashes here.

File details

Details for the file pyrtools-1.0.6-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyrtools-1.0.6-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ceda5aa6f19bc91dd568d933406b04e20c1f955c12f9ea03b34e2ddd485b67e9
MD5 6345f7e1330462a934f677f7e65aeacb
BLAKE2b-256 39ab7db2e90d4138d6e692c7269e9da8a1ad5cfd58239634d0e85660a6410e9b

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