Theoretically, I know that to warp an image, each pixel (x,y)
in the source image is transformed to (x', y')
using a function f (i.e. x'=f(x,y)
& y'=f(x,y)
). But what mathematical equations can I use instead of the function f()
.
For example, I found in a website the following for warping an image:
X' = X + [sin(aX) + cos(cY)] . d where a,b,c and d random values.
y'= the same above
My question: from where such this equation come? Is there any systematic technique to generate such equations and then get the similar warped image below?
Another question How to make a wave warp effect in shader? is asking about the simple wave effect, which is completely different from my question. My question is about how to build equations that represent mapping functions in other complicated warping effects, definitely not simple one like wave equation, and after that how to determine the coefficients “parameters” (a,b,c and d) for these mathematical equations, not by trial and error