Procrustes distance formula explanation
15 views (last 30 days)
Show older comments
Hi, I am using procrustes function from matlab. I am done with the analysis and getting the expected results. Now, I need to write the mathamatical disciption of the formula.
According the explanation on the matlab page,
The procrustes function finds the Procrustes transformation, which is the best shape-preserving Euclidean transformation (consisting of rotation, reflection, scaling, and translation) between the two shapes X and Y. The Procrustes transformation is an optimal transformation that minimizes the sum of squared differences between the landmark points in X and Z, where Z is the transformed shape of Y that results from superimposing Y onto X.
Is there a way to get the equations that matlab uses for the Procrustes transformation?
0 Comments
Answers (1)
Shlok
on 4 Sep 2024
Hi Dipak,
To explore the formulas behind the Procrustes transformation, you can directly view the source code of the “procrustes” function in MATLAB. To do this, type the following command in the command window:
open procrustes;
The formulas used in the “procrustes” function are as follows:
1. Centering:
Subtract the mean of each dataset to center them at the origin:
where and are the means of X and Y.
2. Normalization:
Compute the Frobenius norms (square root of the sum of squared elements) of the centered datasets:
Scale both datasets to unit norm:
3. Optimal rotation and reflection:
Compute the optimal rotation/reflection matrix T that aligns and :
where U and V are the orthogonal matrices from the Singular Value Decomposition (SVD) of A.
4. Reflection handling:
If det(T)<0 and reflection is not desired, adjust T to ensure it's orthogonal with a positive determinant.
5. Scaling:
Compute the optimal scaling factor b if scaling is enabled:
If scaling is not enabled, set b=1.
6. Transformation and distance:
The transformed shape Z is given by:
The sum of squared differences (dissimilarity) is computed as:
Therefore, by using the “open” command, we can view the source code of any function or class in MATLAB. To know more about "open" function, refer to the following documentation link:
0 Comments
See Also
Categories
Find more on Dimensionality Reduction and Feature Extraction in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!