function TT=MeanTransformation(T)

N=size(T,3);
%translation
tmean=sum(T(1:3,4,:),3)./N;
% rotation
RR=sum(T(1:3,1:3,:),3)./N;
[u d v]=svd(RR);
Rmean=u*transpose(v);
%result
TT=[Rmean tmean;0 0 0 1];
