[vtkusers] vtkProcrustesAlignmentFilter error in centroid size

David Netherway david.netherway at adelaide.edu.au
Sat May 10 04:20:23 EDT 2003


The procedure CentroidSize below returns the sum of the distances from
points to the centroid instead of the square root of the sum of squared
distances.
This is contrary to my understanding of the centroid size. Is this an error
or deliberate?

David Netherway

Module: $RCSfile: vtkProcrustesAlignmentFilter.cxx,v $

Date: $Date: 2003/03/11 15:19:30 $

Version: $Revision: 1.10 $

// Calculate the centroid size of a point cloud

static inline double CentroidSize(vtkPoints* pd, float *cp)

{

Centroid(pd, cp);


double S = 0;

for (int i = 0; i < pd->GetNumberOfPoints(); i++)

{

float *p = pd->GetPoint(i);


S += sqrt(vtkMath::Distance2BetweenPoints(p,cp));

}


return S;

}




More information about the vtkusers mailing list