Python library for computing Harmonic Beltrami Signature(HBS)
Project description
HBS - Harmonic Beltrami Signature
This is a Python library for computing Harmonic Beltrami Signature(HBS). It provides a set of tools for boundary conditions, mesh generation, conformal welding and other mathematical problems, particularly suited for numerical computations in complex analysis.
Reference
This implementation is based on the paper:
Harmonic Beltrami Signature: A Novel 2D Shape Representation for Object Classification
Chenran Lin, Lok Ming Lui
DOI: 10.1137/22M1470852
Installation
Install directly from PyPI:
pip install hbs
Or install from source:
- Clone this repository:
git clone https://github.com/ChanceAroundYou/hbs_python.git
- Install dependencies:
pip install -r requirements.txt
Main Modules
hbs.py: HBS algorithm for computing HBS and recontructing shape from HBSboundary.py: Boundary processing toolsconformal_welding.py: Conformal welding algorithm implementationmesh.py: Mesh generation and processingutils/:geodesic_welding.py: Geodesic weldingmobius.py: Möbius transformationspoisson.py: Poisson integral implementationtool_functions.py: Utility functionszipper.py: Zipper algorithm implementation
qc/: Quasiconformal mapping algorithmsbc.py: Beltrami coefficient computationlsqc.py: Least squares quasiconformal mapping algorithm
Usage Example
Compute HBS from image
from boundary import get_boundary
from hbs import get_hbs
img_path = 'img/example.jpg'
bound = get_boundary(img_path, bound_point_num)
hbs, he, cw, disk = get_hbs(bound, circle_point_num, density)
Reconstruct shape from HBS
from hbs import reconstruct_from_hbs
## `disk` must be a DiskMesh corresponding to give `hbs`
bound, _, _, _ = reconstruct_from_hbs(hbs, disk)
Please also refer to example.ipynb
Dependencies
- NumPy
- SciPy
- Matplotlib
- Opencv
Contributing
Contributions are welcome via pull requests.
Code Author
- Chenran Lin
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hbs-0.1.2.tar.gz.
File metadata
- Download URL: hbs-0.1.2.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b10252454ad63adc0371982eee399bd504f9cc023df4f5bed438449f882b022
|
|
| MD5 |
f6b5f3d610c502ffc188ea5c3142965e
|
|
| BLAKE2b-256 |
88f37a954e1221e4534c6b301af629881ab8a992989b6279cf3915447268ba78
|
File details
Details for the file hbs-0.1.2-py3-none-any.whl.
File metadata
- Download URL: hbs-0.1.2-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55187155e7915c0f0b80548b31024c6b65398fc793051c3360ccb52d4cfacb2f
|
|
| MD5 |
e6da803cbbef6375de847ded9d065d90
|
|
| BLAKE2b-256 |
5eb0f515f8b909ffb19c79f07d512f494b9558336dd39d2649b19427b127d69f
|