Skip to main content

Solve the transform vector and rotation matrix of a rigid point set.

Project description

solve_rigid_point_set_rt

Solve the transform vector and rotation matrix of a rigid point set.

Installation

pip install solve_rigid_point_set_rt

Usage

from solve_rigid_point_set_rt import compute_best_rigid_transform
from solve_rigid_point_set_rt import apply_transform
from solve_rigid_point_set_rt import calculate_error
import numpy as np

P = np.array([
    [ 20.606943,  -0.005458,  0.040331],
    [ -4.885081, -26.211561, -0.023027],
    [ 12.012958,  20.049110, -0.035819],
    [-27.734814,   6.167912,  0.018507]
])

Q = np.array([
    [-132.94031926182967, 137.4289669332182, 782.6069181107938],
    [-164.12739196778332, 120.93405919807722, 791.4971644346351],
    [-115.37230320753432, 126.89401508498568, 790.1637162115628],
    [-137.8636773243661, 96.44871350623225, 808.1944560570211]
])

# 2. Compute optimal rotation and translation
R_est, t_est = compute_best_rigid_transform(P, Q)

# 3. Apply transformation and calculate error
P_transformed = apply_transform(P, R_est, t_est)
rmse, mean_dist, _ = calculate_error(P_transformed, Q)

# 4. Print results
print("="*50)
print("Optimal Rotation Matrix R:")
print(R_est)
print("\nOptimal Translation Vector t:")
print(t_est)
print("\nRegistration Accuracy:")
print(f"Root Mean Square Error (RMSE): {rmse:.6f}")
print(f"Mean Euclidean Distance: {mean_dist:.6f}")
print("="*50)

Project details


Download files

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

Source Distribution

solve_rigid_point_set_rt-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solve_rigid_point_set_rt-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file solve_rigid_point_set_rt-0.1.0.tar.gz.

File metadata

  • Download URL: solve_rigid_point_set_rt-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.12 Windows/11

File hashes

Hashes for solve_rigid_point_set_rt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b18afb47459df24577d1db8b06bab9a4a6127be3218e4f386e418af88e2c2928
MD5 e2a878cac41bd6c4d950a9df8117c2a3
BLAKE2b-256 2c0cfc955793e8c5505a6f0532144fa3f96d2e6ea42d1fae6be740cfe8701587

See more details on using hashes here.

File details

Details for the file solve_rigid_point_set_rt-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for solve_rigid_point_set_rt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e80090750054c79aedb5dcbd5555791e0cdebbcf9c7ea5d1bb069ae5302cc0fe
MD5 05198343b36350c2b69d1a6b7e60e432
BLAKE2b-256 2f486a38f9d88b84dae318308912762c91fa076e9282e5e14cadd18d13b6038c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page