This paper deals with generalized procrustes analysis. This is the problem of registering a set of shape data by estimating a reference shape and a set of rigid transformations given point correspondences. The transformed shape data must align with the reference shape as best possible. This is a difficult problem. The classical approach computes alternatively the reference shape, usually as the average of the transformed shapes, and each transformation in turn. We propose a global approach to generalized procrustes analysis for two- and three-dimensional shapes. It uses modern convex optimization based on the theory of Sum Of Squares functions. We show how to convert the whole procrustes problem, including missing data, into a semidefinite program. Our approach is statistically grounded: it finds the maximum likelihood estimate. We provide results on synthetic and real datasets. Compared to classical alternation our algorithm obtains lower errors. The discrepancy is very high when ...