AffineTransformationsPlugin: rewritten a part of the skew estimator to make it more robust