Skip to main content

Easy to use multi-core affine transformations

Project description

Travis Status AppVeyor Status Codecov Status ReadTheDocs Status PyPI PyPI - Python Version Compiler Version license code quality code style Requirements Status

This project explores how C++17 and OpenMP can be combined to write a surprisingly compact implementation of n-dimensional parallel affine transformations which are linked into Python via the affine_transform module.

While this project is still under development, the following features are supported:

  • Linear and cubic (without prefiltering) interpolation
  • Constant boundaries
  • Compiling code for arbitrarily dimensional data
  • Parallelism via OpenMP
  • Arbitrary shaped output arrays, allowing e.g. to only extract a transformed slice

Short example usage

import numpy as np

from affine_transform import transform
from mgen import rotation_from_angle

import matplotlib.pyplot as plt


# Create a simple white square in an image
original = np.zeros((601, 401))
original[100:300, 100:300] = 1

# Rotate by 22.5° (around the centre of the square (200,200))
# and shift +200 in x and +100 in y
transformed = transform(
    original, rotation_from_angle(np.pi / 8), np.array([200, 100]), origin=(200, 200)
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for affine-transform, version 0.2.8
Filename, size File type Python version Upload date Hashes
Filename, size affine_transform-0.2.8.tar.gz (1.1 MB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page