procrustes algorithm gives no T transform matrix back
Show older comments
Hi,
Im having some trouble with the procrustes algorithm. When I enter the code(which is shown below) my transform.T is just a single number.
What am i trying to do:
I have 4 markers in placed in an image and i rotate that image with imrotate3 a several times. When im finnised rotating i select my 4 markers, in the correct order and give them the the procrustes algorithm. The outcome of the algorithm is terrible, what am i doing wrong?
Code:
%Markers
pos1 = [20 20 20];
pos2 = [1 1 1];
pos3 = [size(X,1)/2 1 1];
pos4 = [size(X,1) 1 1];
%pivot coordinats
bpn = [pos1,pos2,pos3,pos4];
%positionEA
epn = [([82 492 24]),([66 510 2]),([35 528 254]),([6 546 507])];
%procrustes
[dissim,Z,trans] = procrustes(bpn',epn');
%outcome
en = bpn-(trans.T)'*epn-(trans.c)';
RMS = rms(norm(en));
Accepted Answer
More Answers (0)
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!