Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As commented by KennyTM you just need an affine transform that is a linear mapping obtained by multiplying every pixel by a matrix <em>M</em> and adding the result to a translation vector <em>V</em>. It's simple math</p> <pre><code>end_pixel_position = M*start_pixel_position + V </code></pre> <p>where <em>M</em> is a composition of simple transformations like rotations or scalings and <em>V</em> is a vector that translates every point of your images by adding fixed coefficients to every pixel.</p> <p>For example if you want to rotate the image you can have a rotation matrix defined as:</p> <pre><code> | cos(a) -sin(a) | M = | | | sin(a) cos(a) | </code></pre> <p>where <code>a</code> is the angle you want to rotate your image by.</p> <p>While scaling uses a matrix of the form:</p> <pre><code> | s1 0 | M = | | | 0 s2 | </code></pre> <p>where <code>s1</code> and <code>s2</code> are scaling factors on both axis.</p> <p>For translation you just have the vector <em>V</em>:</p> <pre><code> | t1 | V = | | | t2 | </code></pre> <p>that adds <code>t1</code> and <code>t2</code> to pixel coordinates.</p> <p>You then combine the matrixes in one single transformation, for example if you have either scaling, rotation and translation you'll end up having something like:</p> <pre><code>| x2 | | x1 | | | = M1 * M2 * | | + T | y2 | | y1 | </code></pre> <p>where:</p> <ul> <li><code>x1</code> and <code>y1</code> are pixel coordinates before applying the transform,</li> <li><code>x2</code> and <code>y2</code> are pixels after the transform, </li> <li><code>M1</code> and <code>M2</code> are matrixes used for scaling and rotation (<strong>REMEMBER:</strong> the composition of matrixes is not commutative! Usually <code>M1 * M2 * Vect != M2 * M1 * Vect</code>),</li> <li><code>T</code> is a translation vector use to translate every pixel.</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload