More
explicitly, suppose sum(p) = (0,0,0,n)^T.
Then, sum(R*P) = R*(sum(P))
= R*(0,0,0,n)^T = (0,0,0,n)^T. Sum(T*R*P) = T*(0,0,0,n)^T = (ntx,nty,ntz,n)^T. (Or just
look at the 2x4 projection matrix). If
we subtract tx or ty from every row,
then the residual is (s11,s12,s13;s21,s22,s23)*P. I = s part of matrix + t part of matrix.