Easy to use multi-core affine transformations
Project description
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
# 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file affine_transform-0.3.2.tar.gz
.
File metadata
- Download URL: affine_transform-0.3.2.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9160f0a5db118332a1483c6b93ddff2944ec1a6e2fef5f15316320c74b6bdea |
|
MD5 | 58069d198c151806ddbcb7c4142f1844 |
|
BLAKE2b-256 | 4a3d673e8cc339d9214a906334a8cb18a4e554a3831afbf87a5efbf549eb437a |