A Python package to compute 3D zernike descriptors.
Project description
3D Zernike Descriptors
pyzernike is a Python library for computing 3D Zernike invariants as descriptors for 3D shape comparison.
Usage
Here's a basic example of how to use the library:
import numpy as np
from pyzernike import ZernikeDescriptor
# Create or load your 3D array here
arr = np.zeros((50,50,50), dtype = np.float32)
arr[15:25, 5:15, 35:45] = 1
# Fit the Zernike descriptor up to order 8
descriptor = ZernikeDescriptor.fit(data = arr, order = 8)
# Get Zernike coefficients
coefficients = descriptor.get_coefficients()
# Reconstruct the array
arr_rec = descriptor.reconstruct(box_size = 50)
# Write the coefficients to a binary file
descriptor.save_invariants("coefficients.inv")
Installation
We recommend installation using one of the following methods
Method | Command |
---|---|
PyPi | pip install pyzernike |
Source | pip install git+https://github.com/maurerv/pyzernike |
[!TIP] pyzernike uses OpenMP for parallelization. On ARM MacOS systems,
brew install llvm libomp
and adding the llvm binary to PATH is required prior to pip install.
Background
pyzernike provides Python bindings to C code written by Marcin Novotni, which was distributed under a GPL license and provided with the paper:
M. Novotni, R. Klein "Shape Retrieval using 3D Zernike Descriptors" Computer Aided Design 2004; 36(11):1047-1062
A copy of that code serving as the basis for this project was obtained from GitHub. pyzernike includes a range of modifications to the original code base to improve performance but faithfully implements the original derivations.
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
Built Distribution
File details
Details for the file zernike_descriptors-0.1.0.tar.gz
.
File metadata
- Download URL: zernike_descriptors-0.1.0.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f2f5d5be0e478018a821e7ef30d850d1d88756d8b4dfbf118e4638131bfe702 |
|
MD5 | 8226994c5defb43d527a981288d4857c |
|
BLAKE2b-256 | 817818063ba65ec340e45a4625e44492a05b704b670d4cb475a345b81294973d |
File details
Details for the file zernike_descriptors-0.1.0-cp311-cp311-macosx_14_0_arm64.whl
.
File metadata
- Download URL: zernike_descriptors-0.1.0-cp311-cp311-macosx_14_0_arm64.whl
- Upload date:
- Size: 108.6 kB
- Tags: CPython 3.11, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b64684c41bc7692e9b65026218dff48218e401391440c5669611c47589ef3074 |
|
MD5 | f230ca3cd649855ef8e4b98747e479c1 |
|
BLAKE2b-256 | 0c121dd58959e503a294ae4c96f86a55f1bb87dfafb9641b1b8fb8cf45f1d124 |