procrustes algorithm gives no T transform matrix back

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));

 채택된 답변

Erik-Jan Meulenbrugge
Erik-Jan Meulenbrugge 2019년 1월 7일

0 개 추천

this works
ePn = [1,20,size(X,1)/2,size(X,2);1,20,1,1;1,20,1,1];
bPn = [82,66,35,6;492,510,528,546;24,2,254,507];
[dissim,Z,trans] = procrustes(ePn',bPn','Scaling',true);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by