Affine transformation matrix paramters conversion

I tried this code for Alignment. It seems not the same as the output in opencv