I was following the code here to correct a distorted image. It works well on small images, however applying it on large images (around 2000x20000) is too slow. griddata takes forever to complete.
I also read other solutions like here, the author uses warpPerspective instead of griddata and remap, but that does not apply to me as I need to correct a distorted image, not simply change view angel
Also there are some discussions about speeding up griddata here, but I don't know how to apply that to my case as the code is quite different