Simple samples to demonstrate 2D Thin Plate Spline Warping.
The keypoint matches are obtained by lightglue matcher on KeyNetAffNetHardNet keypoints.
2D Thin Plate Spline (TPS) warping is a parametric transformation method to transform a source image to a target image.
TPS mapping function
The loss function in 2D TPS warping is composed of two main components: data term and bending energy
This optimization problem has a closed form solution as following:
where
This system of equations has the following constraint:
Hence, can be transformed to the matrix formulation
python3 scripts/test_tps.py --query_path ./data/car1.jpg --ref_path ./data/car2.jpg
query image |
reference image |
warped query image |
warped query image blended with reference |
mamba env create --file environment.yml
mamba activate tps