With reference to the section "Why do raster maps need to be geo-referenced?", the geometrical state of a non-geo-referenced raster map is summarized by Fig. 1 where the disorientation angle has been abnormally increased, only for making it evident for this description.
The raster has its own reference system with origin (0,0) in its lower-left vertex and the vertical axis is not parallel to the map’s North axis (Disorientation). In addition, the raster units are the image pixels, not meters.
As explained in section "What should I do to geo-reference and rectify my map?", if we do not consider the map deformation, our goal is to port the raster at the real map coordinates, correct the orientation error and transform the units from pixel into real units, i.e. meters.
The Affine 4 parameters transformation that we’ll see in this section is one of the possible methods to achieve this result. The algorithm consists in a roto-translation between two reference systems: the raster and the map. Mathematically, to transform the coordinates from one reference system to another, at least the coordinates of 2 points in both systems are needed.
Fig. 2 shows the roto-translation schema: Eo and No are the East/North translations between the origin of the raster system (red axis) and the origin of the map system (blue axis), whereas ε is the rotation angle between the two systems. P and Q are the two (minimum) points, known in the two reference systems, needed to transform raster coordinates into map coordinates.
Even though two known points in both systems are sufficient to solve this transformation, it is obviously advised to use more points in order to have a more accurate calculation.
Using more than two points implies that a scale factor between the two systems is generated due to the surplus of measurements.
So, for a generic point P the matrix formula of this transformation is:
This notation makes quite clear why this transformation is called “4 Parameters”, there are in fact 4 values we need to calculate in order to transform the raster coordinates of one point into its corresponding map coordinates. These 4 parameters are: Eo, No, f, ε, i.e. the two East/North translations of the raster origin, the scale factor and the rotation angle.
The images below show the 4 transformation parameters, i.e. the 4 movements that we need to apply to the raster in order to solve this geo-referencing.