Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Apply quadratic function to an image

Hello.

I have a quadratic function I would like to apply to my image. The transformation has the following form:

  • x' = A + Bx + Cy + Dxx + Exy + Fyy
  • y' = G + Hx + Iy + Jxx + Kxy + Lyy

For a linear transformation:

  • x' = A + Bx + Cy
  • y' = D + Ex + Fy

it was easy because I could use WarpAffine by putting the coefficients in a 3x2 matrix. Moreother, is it easy to get the value of rotation angle and scale ?

Again, with the linear transformation, rotation angle is easily computed with atan2(B, C). Scale is (sqrt(BB + CC) and shifts are A and D.