static void getScale(Mat2D m, Vec2D s) { double x = m[0]; double y = m[1]; s[0] = x.sign * sqrt(x * x + y * y); x = m[2]; y = m[3]; s[1] = y.sign * sqrt(x * x + y * y); }