All Projects → jewettaij → superpose3d

jewettaij / superpose3d

Licence: MIT license
register 3D point clouds using rotation, translation, and scale transformations.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to superpose3d

OverlapPredator
[CVPR 2021, Oral] PREDATOR: Registration of 3D Point Clouds with Low Overlap.
Stars: ✭ 293 (+761.76%)
Mutual labels:  point-cloud, registration
Fast gicp
A collection of GICP-based fast point cloud registration algorithms
Stars: ✭ 307 (+802.94%)
Mutual labels:  point-cloud, registration
Pycpd
Pure Numpy Implementation of the Coherent Point Drift Algorithm
Stars: ✭ 255 (+650%)
Mutual labels:  point-cloud, registration
simpleICP
Implementations of a rather simple version of the Iterative Closest Point algorithm in various languages.
Stars: ✭ 140 (+311.76%)
Mutual labels:  point-cloud, point-cloud-registration
Overlappredator
[CVPR 2021, Oral] PREDATOR: Registration of 3D Point Clouds with Low Overlap.
Stars: ✭ 106 (+211.76%)
Mutual labels:  point-cloud, registration
DeepI2P
DeepI2P: Image-to-Point Cloud Registration via Deep Classification. CVPR 2021
Stars: ✭ 130 (+282.35%)
Mutual labels:  point-cloud, registration
Probreg
Python package for point cloud registration using probabilistic model (Coherent Point Drift, GMMReg, SVR, GMMTree, FilterReg, Bayesian CPD)
Stars: ✭ 306 (+800%)
Mutual labels:  point-cloud, registration
YOHO
[ACM MM 2022] You Only Hypothesize Once: Point Cloud Registration with Rotation-equivariant Descriptors
Stars: ✭ 76 (+123.53%)
Mutual labels:  point-cloud, registration
Ppf Foldnet
PyTorch reimplementation for "PPF-FoldNet: Unsupervised Learning of Rotation Invariant 3D Local Descriptors" https://arxiv.org/abs/1808.10322
Stars: ✭ 51 (+50%)
Mutual labels:  point-cloud, registration
Unsupervisedrr
[CVPR 2021 - Oral] UnsupervisedR&R: Unsupervised Point Cloud Registration via Differentiable Rendering
Stars: ✭ 43 (+26.47%)
Mutual labels:  point-cloud, registration
Ndt omp
Multi-threaded and SSE friendly NDT algorithm
Stars: ✭ 291 (+755.88%)
Mutual labels:  point-cloud, registration
3d Pointcloud
Papers and Datasets about Point Cloud.
Stars: ✭ 179 (+426.47%)
Mutual labels:  point-cloud, registration
Cilantro
A lean C++ library for working with point cloud data
Stars: ✭ 577 (+1597.06%)
Mutual labels:  point-cloud, registration
Deepmapping
code/webpage for the DeepMapping project
Stars: ✭ 140 (+311.76%)
Mutual labels:  point-cloud, registration
Cupoch
Robotics with GPU computing
Stars: ✭ 225 (+561.76%)
Mutual labels:  point-cloud, registration
djaodjin-signup
Django app for frictionless signup
Stars: ✭ 18 (-47.06%)
Mutual labels:  registration
combining3Dmorphablemodels
Project Page of Combining 3D Morphable Models: A Large scale Face-and-Head Model - [CVPR 2019]
Stars: ✭ 80 (+135.29%)
Mutual labels:  registration
Scan2Cap
[CVPR 2021] Scan2Cap: Context-aware Dense Captioning in RGB-D Scans
Stars: ✭ 81 (+138.24%)
Mutual labels:  point-cloud
icra20-hand-object-pose
[ICRA 2020] Robust, Occlusion-aware Pose Estimation for Objects Grasped by Adaptive Hands
Stars: ✭ 42 (+23.53%)
Mutual labels:  registration
SpareNet
Style-based Point Generator with Adversarial Rendering for Point Cloud Completion (CVPR 2021)
Stars: ✭ 118 (+247.06%)
Mutual labels:  point-cloud

CircleCI codecov CodeQL GitHub PyPI - Downloads PyPI - Version python-versions GitHub code size in bytes

superpose3d

Note: There is a C++ version of this repository here.

Usage

def Superpose3D(X,    # <-- Nx3 array of coords for the "frozen" point cloud
                x,    # <-- Nx3 array of coords for the "mobile" point cloud
                # ---- optional arguments: ----
                w = None,        # optional weights for the calculation of RMSD
                allow_rescale=False,   # attempt to rescale mobile point cloud?
                report_quaternion=False)      # report rotation angle and axis?

Superpose3D() takes two lists (or numpy arrays) of xyz coordinates (of the same length, N) representing two ordered sets of points ("clouds", X and x). Treating them as rigid objects, "Superpose3D()" attempts to superimpose them using rotations, translations, and (optionally) scale transformations in order to minimize the root-mean-squared-distance (RMSD) between corresponding points from either cloud, where RMSD is defined as:

...where:

   R_ij = a rotation matrix    (a 3x3 numpy array representing the rotation. |R|=1)
   T_j  = a translation vector (a 1-D numpy array containing x,y,z displacements)
    c   = a scalar             (a number. optional. 1 by default)

This function returns a 4-tuple containing the optimal values of:

   (RMSD, R, T, c)

Note: This function does not attempt to determine which pairs of points from either cloud correspond. Instead, it infers them from the order of the arrays. (It assumes that the i'th point from X corresponds to the i'th point from x.)

Note: The point clouds must contain the same number of points (N). If the number of points in either cloud is not the same, you must use a different approach. (See: link1, link2, link3, link4.)

Rotation angles, axes, and quaternions

If the rotation angle and axis are needed, then set the report_quaternion argument to True. In that case, the function will return this 4-tuple instead:

   (RMSD, q, T, c)

...where q is a numpy array of size 4. The first element of q will store cos(θ/2) (where θ is the rotation angle). The remaining 3 elements of q form a vector (of length sin(θ/2)), pointing along the axis of rotation. Equivalently, q is the quaternion corresponding to rotation R.

Weighted RMSD

A weighted version of the RMSD minimization algorithm is also available if the caller supplies an extra argument specifying the weight of every point in the cloud (wn). In that case, RMSD is defined as:

Algorithm

This function implements a more general variant of the method from this paper: R. Diamond, (1988) "A Note on the Rotational Superposition Problem", Acta Cryst. A44, pp. 211-216.

Scale transformations

This version has been augmented slightly to support scale transformations. (I.E. multiplication by scalars. This can be useful for the registration of two different annotated volumetric 3-D images of the same object taken at different magnifications.)

Note that if you enable scale transformations (i.e. if allow_rescale=True), you should be wary if the function returns a negative c value. Negative c values correspond to inversions (reflections). For this reason, if you are using this function to compare the conformations of molecules, you should probably set allow_rescale=False. This will prevent matching a molecule with its stereoenantiomer.

Installation using pip

pip install .

Later, you can uninstall superpose3d using:

pip uninstall superpose3d

Requirements

superpose3d depends on numpy

License

superpose3d is available under the terms of the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].