资源简介
立体匹配程序,包括基本矩阵求解,极线校正和SSD算法
代码片段和文件信息
function [ARt]=art(Pfsign)
%ART Factorize camera matrix into intrinsic and extrinsic matrices
%
% [ARt] = art(Pfsign) factorize the projection matrix P
% as P=A*[R;t] and enforce the sign of the focal lenght to be fsign.
% By default fsign=1.
% Author: A. Fusiello 1999
%
% fsign tells the position of the image plane wrt the focal plane. If it is
% negative the image plane is behind the focal plane.
% by default assume POSITIVE focal lenght
if nargin == 1
fsign = 1;
end
s = P(1:34);
Q = inv(P(1:3 1:3));
[UB] = qr(Q);
% fix the sign of B(33). This can possibly change the sign of the resulting matrix
% which is defined up to a scale factor however.
sig = sign(B(33));
B=B*sig;
s=s*sig;
% if the sign of the focal lenght is not the required one
% change it and change the rotation accordingly.
if fsign*B(11) < 0
E= [-1 0 0
0 1 0
0 0 1];
B = E*B;
U = U*E;
end
if fsign*B(22) < 0
E= [1 0 0
0 -1 0
0 0 1];
B = E*B;
U = U*E;
end
% if U is not a rotation fix the sign. This can possibly change the sign
% of the resulting matrix which is defined up to a scale factor however.
if det(U)< 0
U = -U;
s= - s;
end
% sanity check
if (norm(Q-U*B)>1e-10) & (norm(Q+U*B)>1e-10)
error(‘Something wrong with the QR factorization.‘); end
R = U‘;
t = B*s;
A = inv(B);
A = A ./A(33);
% sanity check
if det(R) < 0 error(‘R is not a rotation matrix‘); end
if A(33) < 0 error(‘Wrong sign of A(33)‘); end
% this guarantee that the result *is* a factorization of the given P up to a scale factor
W = A*[Rt];
if (rank([P(:) W(:)]) ~= 1 )
error(‘Something wrong with the ART factorization.‘); end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1825 2009-04-16 19:21 stero\art.m
文件 6148 2009-04-16 19:21 stero\data\.DS_Store
文件 285 2011-04-24 21:25 stero\data\coordinate_points.mat
文件 74 2011-04-24 21:12 stero\data\left_image_points.txt
文件 621 2011-04-24 19:36 stero\data\project.m
文件 70 2011-04-24 21:13 stero\data\right_image_points.txt
文件 422 2011-04-24 19:36 stero\data\Sport_cam.mat
文件 28 2011-04-24 20:51 stero\data\Sport_points
文件 28 2011-04-24 20:51 stero\data\Sport_points.asv
文件 3106 2011-04-23 19:41 stero\FM.mat
文件 786 2011-05-04 17:11 stero\fund.m
文件 6148 2009-04-16 19:21 stero\images\.DS_Store
文件 89841 2011-04-24 18:58 stero\images\Sport0.JPG
文件 89345 2011-04-24 18:58 stero\images\Sport1.JPG
文件 70847 2011-04-25 15:30 stero\imagesE\Sport_R_0.jpg
文件 468180 2011-05-05 09:35 stero\imagesE\Sport_R_0.png
文件 545182 2011-05-05 09:35 stero\imagesE\Sport_R_1.png
文件 2321 2009-04-16 19:21 stero\imwarp.m
文件 630 2009-04-16 19:21 stero\ivec.m
文件 793 2011-05-03 21:43 stero\mcbb.m
文件 643 2011-05-03 21:37 stero\p2t.m
文件 797 2011-04-23 21:50 stero\plotseg.m
文件 1794 2009-04-16 19:21 stero\rectify.m
文件 3194 2011-05-03 20:57 stero\rectifyImageE.asv
文件 3364 2011-05-03 22:56 stero\rectifyImageE.m
文件 611 2011-05-04 20:30 stero\ssd.asv
文件 672 2011-05-04 21:36 stero\ssd.m
文件 356 2009-04-16 19:21 stero\star.m
文件 798 2011-05-04 21:31 stero\stereo_matching.asv
文件 823 2011-05-05 09:30 stero\stereo_matching.m
............此处省略8个文件信息
- 上一篇:PySide教程
- 下一篇:NGW行星减速器,用于参考设计!
评论
共有 条评论