Skip to content

Coherent-Point-Drift Implementation in Pytorch for 2D and 3D Point Cloud Registration

License

Notifications You must be signed in to change notification settings

mikami520/CPD-Pytorch

Repository files navigation

CPD-Pytorch

CPD-Pytorch

Coherent Point Drift Implementation in pytorch version

Installation

git clone https://github.com/mikami520/CPD-Pytorch.git
cd CPD-Pytorch
pip install -e .

Example Usage

from functools import partial
import matplotlib.pyplot as plt
from torchcpd import RigidRegistration
import numpy as np
import torch as th

device = 'cuda:0' if th.cuda.is_available() else 'cpu'
X = np.loadtxt('data/bunny_target.txt')
# synthetic data, equaivalent to X + 1
Y = np.loadtxt('data/bunny_source.txt')

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

callback = partial(visualize, ax=ax, fig=fig, save_fig=False)

reg = RigidRegistration(**{'X': X, 'Y': Y, 'device': device})
reg.register(callback)
plt.show()

More tutorials can be found in the /examples folder.

Star History

Star History Chart

About

Coherent-Point-Drift Implementation in Pytorch for 2D and 3D Point Cloud Registration

Topics

Resources

License

Stars

Watchers

Forks

Languages