plot3dresidua.m
来自「三维重建」· M 代码 · 共 51 行
M
51 行
function plot3DResidua(ste,X,Y, meth)
%
% PLOT3DRESIDUA(ste,X,Y,meth)
%
% Estimates the depth of the image coordinate pairs stored in X and plot
% the spatial residua. If meth = 0 GETOBJECTCOORDINATES function is used
% for depth computation, otherwise MULTIPLEPOINTRECONSTRUCTION.
%
% As the residua normally are to small, their direction is shown by the
% red lines while the green lines show the actual residua.
%
%
%
if nargin < 4
meth = 0;
end
if meth == 0
R = getObjectCoordinates(ste,X,Y);
else
[R, Py , V] = multiplePointReconstruction(ste,X,1)
end
r = R - Y;
max_scale = 3;
%-------determining line length----
mu_abs = [];
for i = 1:size(r,1)
mu_abs = [mu_abs, norm(r(i,:))];
end
mu_abs = mean(mu_abs);
mxlen = max(mu_abs);
scal_fac = max_scale/mxlen;
%----------------------------------
for i = 1:size(X,1)
plot3(Y(i,1),Y(i,2),Y(i,3),'x','Color','black');hold on,
line([Y(i,1),Y(i,1) + scal_fac*r(i,1)],[Y(i,2),Y(i,2) + scal_fac*r(i,2)],[Y(i,3),Y(i,3) + scal_fac*r(i,3)],'Color','red'); hold on
line([Y(i,1),Y(i,1) + r(i,1)],[Y(i,2),Y(i,2) + r(i,2)],[Y(i,3),Y(i,3) + r(i,3)],'Color','green'); hold on
grid on
hold on;
end
mu = norm(mean(r));
title(['\mu = [' num2str(mu) ']' ...
'\newline \mu_{abs} = [' num2str(mu_abs) ']'])
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?