필터 지우기
필터 지우기

what does this code mean ?

조회 수: 2 (최근 30일)
Karn Vadaliya
Karn Vadaliya 2019년 3월 19일
댓글: Torsten 2019년 3월 25일
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개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by