I've added documentation for the function that calculates an affine transformation normalizing given image.