4
$\begingroup$

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)] \dot\ 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?

warped image

My question is about how to build equations that represent mapping functions in complicated warping effects for example one that produces such above warping image, and then how to determine values of the coefficients “parameters” for these mathematical equations, definitely not by trial and error.

$\endgroup$

closed as off-topic by Daniel W. Farlow, M. Vinay, JonMark Perry, user91500, Claude Leibovici Jun 30 '16 at 5:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Daniel W. Farlow, JonMark Perry, user91500, Claude Leibovici
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ See adrianboeing.blogspot.com.br/2011/02/… and gamedev.stackexchange.com/questions/90592/… for an example. $\endgroup$ – lhf Jun 29 '16 at 17:58
  • 1
    $\begingroup$ Actually the sky is the limit. Any $x^\prime=f(x,y),y^\prime=g(x,y)$ will transform the image into a 'warped' image. If $f$ and $g$ are composed of sinusoidal functions (sine and cosine) then you will have a ripple effect of some sort. But the possibilities are limitless. First one must decide upon what kind of distortion one would like, then find an equation to do that. As an example, in face recognition, the position of certain fixed points on the face are recorded. One might wish a function which would distort one person's face so it would match the characteristic points of another's face. $\endgroup$ – John Wayland Bales Jun 29 '16 at 18:16