koide3 / fast_gicp

A collection of GICP-based fast point cloud registration algorithms
BSD 3-Clause "New" or "Revised" License
1.29k stars 319 forks source link

Feature/support getting fitness score through python api #88

Closed HViktorTsoi closed 2 years ago

HViktorTsoi commented 2 years ago

Add support for getting fitness score through python api.

Usage:

# 1. function interface
import pygicp

target = # Nx3 numpy array
source = # Mx3 numpy array

# 2. class interface
# you may want to downsample the input clouds before registration
target = pygicp.downsample(target, 0.25)
source = pygicp.downsample(source, 0.25)

# pygicp.FastGICP has more or less the same interfaces as the C++ version
gicp = pygicp.FastGICP()
gicp.set_input_target(target)
gicp.set_input_source(source)
matrix = gicp.align()

# optional
gicp.set_num_threads(4)
gicp.set_max_correspondence_distance(1.0)
gicp.get_final_transformation()
gicp.get_final_hessian()
# here
gicp.get_fitness_score(max_range=1.0) 
koide3 commented 2 years ago

Thanks for your PR. I'll merge it soon.