[Request] Apply transformation to new set of points
Closed this issue · 2 comments
Is it possible to transform a second new set of points given the registration parameters calculated on a different set?
Yes. Note that for TPS parameters, they are bundled with the input ctrl pts used in the optimization. To apply the TPS transformation on a different point set, we can first build the basis and kernel matrices by calling
[basis, kernel] = prepare_TPS_basis(model, ctrl_pts)
as in https://github.com/bing-jian/gmmreg-python/blob/master/src/_core.py#L201
where 'model' can be replaced by the new point set to be transformed.
Then we just simply call
after_tps = transform_points(x, basis)
where x contains the TPS parameter associated with the ctrl_pts.
Much appreciated! it works exactly as you instructed.