anj1 / ThinPlateSplines.jl

Thin-plate splines in Julia
MIT License
5 stars 4 forks source link

Runtime in applying the warp #3

Closed RainerHeintzmann closed 1 year ago

RainerHeintzmann commented 1 year ago

Great Work! Trying to apply it to warping larger images, I noticed that there is a runtime issue. This may be partly due to the tps_deform function needing too many allocations, which I guess could be fixed somehow. However, a more serious issue is the general runtime behaviour. As far as I see from the code, all warp nodes have an influence on the each of the pixels to warp. If the input data is gridded (i.e. just the coordinates of the input image to warp as in my case), is there a simple way to prune the warps during application, such that only the neighboring control points will have a significant influence?

RainerHeintzmann commented 1 year ago

... I looked into this and was able to gain about a factor of 100 in speed (6 sec instead of 10 min). If you like I can do a pull request.

RainerHeintzmann commented 1 year ago

... I looked into this and was able to gain about a factor of 100 in speed (6 sec instead of 10 min). If you like I can do a pull request.

RainerHeintzmann commented 1 year ago

... made a pull request.

RainerHeintzmann commented 1 year ago

@anj1 Thanks for merging!