Convert homogeneous transform to rotation and translation
[R,t] = tr2rt(TR)
[R,t] = TR2RT(TR) split a homogeneous transformation matrix (NxN) into an orthonormal rotation matrix R (MxM) and a translation vector t (Mx1), where N=M+1.
A homogeneous transform sequence TR (NxNxK) is split into rotation matrix sequence R (MxMxK) and a translation sequence t (KxM).
Works for TR in SE(2) or SE(3)
If TR is 4x4, then R is 3x3 and T is 3x1.
If TR is 3x3, then R is 2x2 and T is 2x1.
The validity of R is not checked