Skip to main content

pointpca2-pylib

Purpose

Python bindings for the pointpca2-rs Rust backend. The package extracts 40 PointPCA2 predictors from a reference and a distorted colored point cloud. These predictors are intended for subsequent regression; the package does not train a model or return a perceptual quality score.

The PyPI distribution and Python import are both named pointpca2.

The numerical implementation is maintained in pointpca2-rs. MAPPE uses the Python package for mesh quality assessment. Refer to the backend repository for algorithm implementation details.

Requirements

  • Python >=3.10,<3.13; Python 3.11 or 3.12 is recommended for use with the MAPPE workspace.
  • NumPy and the other runtime dependencies declared in pyproject.toml.
  • For source builds: uv, a current stable Rust toolchain, Cargo, a native linker/C compiler, and Git. uv installs Maturin and the other development tools.

Installation

From PyPI

In a Python 3.11 or 3.12 environment:

python -m pip install pointpca2

A compatible wheel does not require a local Rust toolchain. To build from source, use the checkout instructions below.

From source

git clone https://github.com/arthurhscarvalho/pointpca2-pylib.git
cd pointpca2-pylib
uv sync --locked --python 3.12

uv creates .venv/, installs the project as an editable package through Maturin, and installs the development tools declared in pyproject.toml. uv.lock records the resolved dependencies. No environment activation is needed when using uv run.

Cargo fetches pointpca2-rs from Git tag v1.5.1, as declared in Cargo.toml. A sibling backend checkout is not required. After changing the Rust binding or its backend dependency, rebuild the extension:

uv run --locked maturin develop --release

To build a release wheel:

uv run --locked maturin build --release --out dist

Usage

import numpy as np
from pointpca2 import compute_pointpca2

# Replace these files with your own coordinate and RGB arrays.
points_reference = np.load("reference_points.npy")
colors_reference = np.load("reference_colors.npy")
points_test = np.load("distorted_points.npy")
colors_test = np.load("distorted_colors.npy")

predictors = compute_pointpca2(
    points_reference,
    colors_reference,
    points_test,
    colors_test,
    search_size=81,
    max_workers=0,
    verbose=False,
)
print(predictors.shape)  # (40,)
Argument Description
points_reference, points_test XYZ coordinate arrays of shape (N, 3) and (M, 3), converted to float64.
colors_reference, colors_test Matching RGB arrays, with the same shape as their cloud's coordinates. Supply integer values in [0, 255] or floating-point values in [0, 1]; the backend receives uint8.
search_size Neighborhood size; defaults to 81. Use a positive value no larger than the distinct point count of either cloud after duplicate merging.
max_workers Rayon thread-pool size; 0 uses the default based on logical CPUs.
verbose Enables processing messages; defaults to False.

The clouds may contain different numbers of points, but both require colors. The result is a one-dimensional float64 NumPy array of shape (40,). Normalized floating-point color arrays are scaled in place by the Python wrapper; pass copies if you need to preserve them.

A complete PLY-loading example and sample clouds are included in examples/example_compute_predictors.py. From the repository root, install the example dependencies and run:

uv sync --locked --python 3.12 --group examples
uv run --locked --group examples python examples/example_compute_predictors.py

Publications

The first publication describes this implementation. The second describes the original PointPCA+ method, referred to as PointPCA2 in this project.

  1. Arthur Henrique Silva Carvalho and Pedro Garcia Freitas. “PointPCA2-RS: PointPCA2 with Resource Saving.” XLIII Brazilian Symposium on Telecommunications and Signal Processing (SBrT), Natal, Brazil, 2025. Paper.
  2. Xuemei Zhou, Evangelos Alexiou, Irene Viola, and Pablo Cesar. “PointPCA+: A full-reference Point Cloud Quality Assessment metric with PCA-based features.” Signal Processing: Image Communication, vol. 135, article 117262, 2025. DOI: 10.1016/j.image.2025.117262.
@inproceedings{carvalho2025pointpca2rs,
  author    = {Carvalho, Arthur Henrique Silva and Freitas, Pedro Garcia},
  title     = {{PointPCA2-RS}: {PointPCA2} with Resource Saving},
  booktitle = {XLIII Brazilian Symposium on Telecommunications and Signal Processing (SBrT)},
  address   = {Natal, Brazil},
  year      = {2025},
  url       = {https://biblioteca.sbrt.org.br/articlefile/4834.pdf}
}

@article{zhou2025pointpcaplus,
  author  = {Zhou, Xuemei and Alexiou, Evangelos and Viola, Irene and Cesar, Pablo},
  title   = {{PointPCA+}: A full-reference Point Cloud Quality Assessment metric with {PCA}-based features},
  journal = {Signal Processing: Image Communication},
  volume  = {135},
  pages   = {117262},
  year    = {2025},
  doi     = {10.1016/j.image.2025.117262}
}

License

MIT License.

Metadata

Release files for pointpca2 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pointpca2 0.5.2
File
pointpca2-0.5.2-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pointpca2-0.5.2-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details
pointpca2-0.5.2-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
pointpca2-0.5.2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pointpca2-0.5.2-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
pointpca2-0.5.2-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
pointpca2-0.5.2-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
pointpca2-0.5.2-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
pointpca2-0.5.2-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 3.5 MB

Release files / pointpca2-0.5.2-cp312-cp312-win_amd64.whl

Download URL pointpca2-0.5.2-cp312-cp312-win_amd64.whl
Size 301.7 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
47ef7246f70d1957995f840d174b0ed08d17a70effd80606f26bd1b805a3bbda
BLAKE2b-256 checksum
How to use checksums
b977c3c1b8d7ea3b5828d10210b237f5a1f7b6db28e1dde56f64983f6fb74484
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pointpca2-0.5.2-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL pointpca2-0.5.2-cp312-cp312-manylinux_2_28_x86_64.whl
Size 471.5 kB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2c2b5c6e47456b1c862d29bd570c755b3d372d84089f265a2057c47ed34dfb48
BLAKE2b-256 checksum
How to use checksums
dd025ec61b0d419054e4394e7d4ca2b6a7ee26aa00a63fa409336dc5335575ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pointpca2-0.5.2-cp312-cp312-macosx_11_0_arm64.whl

Download URL pointpca2-0.5.2-cp312-cp312-macosx_11_0_arm64.whl
Size 386.8 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
50e2c3f3afec2c52b84bd8a08d42e10e714eb81315815328c04507636795415d
BLAKE2b-256 checksum
How to use checksums
4b240c5262676f5396652f895b5414ff1a36c214c151b4b8e488ab1552ec59b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pointpca2-0.5.2-cp311-cp311-win_amd64.whl

Download URL pointpca2-0.5.2-cp311-cp311-win_amd64.whl
Size 300.2 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
73b89f9b7c5c7409386f64f764b01556e0b953d4b4ae6c6219e2007100dbf285
BLAKE2b-256 checksum
How to use checksums
8d8f39e38fe741ea7416a52626fccefdfbca7cc9a94e0bcd5049cb71fb5fe468
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pointpca2-0.5.2-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL pointpca2-0.5.2-cp311-cp311-manylinux_2_28_x86_64.whl
Size 472.4 kB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
dff0fc0bc75b5e8b044e9840e435ccb4ab979c21bfa208dbccffc2b2e3e4c22a
BLAKE2b-256 checksum
How to use checksums
8c62df0905767201d3b45fb7904eaa38d16c523dd5b56e18644df6ed2fd896ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pointpca2-0.5.2-cp311-cp311-macosx_11_0_arm64.whl

Download URL pointpca2-0.5.2-cp311-cp311-macosx_11_0_arm64.whl
Size 390.0 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f46b394cbf593341f52fcd4be19118d6f510fc1a6dbf5f5772b5e5ed60570ae2
BLAKE2b-256 checksum
How to use checksums
cd3e98aecdad66de31a43d99a6d9da23ea4ea53cb3892b9607fb8cb1a93a68ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pointpca2-0.5.2-cp310-cp310-win_amd64.whl

Download URL pointpca2-0.5.2-cp310-cp310-win_amd64.whl
Size 300.3 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
1f8a94a2208bd77bd3f73d5c0a7b7414ee8148a5d0617b1091a5df1ce239ea9a
BLAKE2b-256 checksum
How to use checksums
860f90a2bb725a328aba501642bff1c639221d39c4592f8c51304a6b0c389da5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pointpca2-0.5.2-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL pointpca2-0.5.2-cp310-cp310-manylinux_2_28_x86_64.whl
Size 472.3 kB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
92b0a30939cf4d9e7c7f7c1a8fe028dc5be5769e80e24cae4681a9a2af5b8b8c
BLAKE2b-256 checksum
How to use checksums
87e70f9ef673a1be9ac9016fbc32b61831621bf98cc9ec67c734c760c0a4eadf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pointpca2-0.5.2-cp310-cp310-macosx_11_0_arm64.whl

Download URL pointpca2-0.5.2-cp310-cp310-macosx_11_0_arm64.whl
Size 389.4 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d2230982f6684f3fce2193dc2ca5f07feaf0e3c57d60abe09b99e9f68312ef41
BLAKE2b-256 checksum
How to use checksums
5ccd8ba84f562552362784bf0d8f5d12ef62c44ca49834a157917e9baeb0ff9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Security for pointpca2 0.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page