Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

what does this code mean ?

조회 수: 3 (최근 30일)
Karn Vadaliya
Karn Vadaliya 2019년 3월 19일
마감: Sabin 2025년 6월 20일
function PV=Get_Pivot_Point(PP)
% PP dimension: (no. of observation X 4 [no. of markers] X 3[x,y,z 3-d coordinate of marker] )
pv_tool = squeeze(PP(1,:,:));
%pv_tool=[0 0 0 ; 0 0 50; 0 25 100 ; 0 -25 135];
p_pairs=nchoosek(1:size(PP,1),2);
num_exapmple=10;
whos
pivot_points=[]
for k=1:10
P1=[];
P2=[];
rp=randperm(size(p_pairs,1),num_exapmple)
rp_a=p_pairs(rp,1);
rp_b=p_pairs(rp,2);
for i=1:10
P1=[P1 ; squeeze(PP(rp_a(i),:,:))'];
P2=[P2 ; squeeze(PP(rp_b(i),:,:))'];
end
X=compute_pivot_point(P1,P2);
tmp_pivot_points=[];
for j=1:size(PP,1)
[T, Eps] = estimateRigidTransform(pv_tool', squeeze(PP(j,:,:))); % (target, source)
tmp_pivot_points=[tmp_pivot_points ; transformPoint3d(X',T)];
end
pivot_points=[pivot_points ; mean(tmp_pivot_points)];
end
plot3(pv_tool(:,1),pv_tool(:,2),pv_tool(:,3),'r*')
hold on
plot3(pivot_points(:,1), pivot_points(:,2), pivot_points(:,3),'b*')
grid on
axis equal
PV.pv_point=median(pivot_points);
PV.pv_tool=pv_tool;
end
function X=compute_pivot_point(P1,P2)
[X, R] = linsolve([P2-P1],sum([P2.^2-P1.^2], 2)/2);
end
  댓글 수: 7
Karn Vadaliya
Karn Vadaliya 2019년 3월 24일
Then what is it ?
Torsten
Torsten 2019년 3월 25일
https://en.wikipedia.org/wiki/Scaling_(geometry)

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by