资源简介
matlab环境下的基于LMedS算法求解两图像之间的基础矩阵
代码片段和文件信息
function t = ant_cfnsf(x1y1x2y2m3f_init)
% This is the code to estimate the fundamental matrix using
% the constrained vesrion of the fundamental numerical scheme.
% It has been written so as to be included in Phil Torr‘s
% structure and motion package (see http://research.microsoft.com/downloads/)
% for the purposes of comparing estimators.
% For a description of the method see
% http://www.cs.adelaide.edu.au/users/hengel/Vision/ParameterEstimation/index.html
% Anton van den Hengel - anton@cs.adelaide.edu.au
% The m3 thing makes things a little bit more complicated. The error measures all use
% m3 set to some number which usually isn‘t 1. So we need to do the estimation
% taking that into account. The problem is that we need to (Hartley) normalise the
% data before we do cfns or it won‘t work and I‘m not sure that the m3 thing is equivalent
% as it‘s only a scaling and not a recentering and I haven‘t tested it.
[x1y1x2y2] = HartleyNormaliseFData(x1y1x2y2);
if nargin < 5 | nargin > 6
error(‘Wrong number of args to fns‘);
elseif nargin == 5
% We don‘t have an initial estimate so we need to generate one
t = torr_estf(x1y1x2y2length(x1)1);
else
% Need to be careful with initial estimates because they have to
% be calculated with m3 = 1
t = f_init;
end
iter = 0;
t_old = ones(size(t));
while ((iter < 5) & (norm(t - t_old) > 1e-8))
iter = iter + 1;
t_old = t;
ZZ = constFnsFactorMatrix(tx1y1x2y2);
%[MZZ] = fnsJamlMatrices(tx1y1x2y2);
[v l] = eig(ZZ);
l = abs(diag(l));
[l indices] = sort(l);
t = v(: indices(1));
% Normalise just for numerical stability
t = t/norm(t‘fro‘);
end
% Undo the Hartley Normalisation
t = unNormalise(t);
% And put the result into the right form re m3
T = eye(3);
T(33)=m3;
PhilT=inv(T);
t = reshape((PhilT‘ * reshape(t33)‘ * PhilT)‘91);
t = t/norm(t‘fro‘);
return
function [MXH] = fnsJamlMatrices(tx1y1x2y2)
%
% Computes M_theta and X_theta (see the paper for details)
% It is possible to make this faster but at the cost of
% making it harder to understand
Xbits = zeros(99);
M = zeros(99);
T = zeros(99);
tt = t*t‘; % Just to speed things up a little
u = zeros(91);
du = zeros(9 4); du(7 1) = 1; du(8 2) = 1; du(3 3) = 1; du(6 4) = 1;
for i = 1:length(x1)
u = [x1(i) * x2(i) y1(i) * x2(i) x2(i) x1(i) * y2(i) ...
y1(i) * y2(i) y2(i) x1(i) y1(i) 1]‘;
A = u * u‘;
% Maybe it would be faster to do these as a block?
du(1 1) = x2(i);
du(4 1) = y2(i);
du(2 2) = x2(i);
du(5 2) = y2(i);
du(1 3) = x1(i);
du(2 3) = y1(i);
du(4 4) = x1(i);
du(5 4) = y1(i);
% use identity covs ...
B = du * du‘;
theta_b_theta = t‘ * B * t;
M = M + (A / theta_b_theta);
if nargout > 1
tAt = t‘ * A * t;
Xbits = Xbits - B * ((tAt) / (theta_b_theta^2));
if nargout ==
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-11-30 16:44 5LMedS算法\
文件 8186497 2017-11-30 16:44 5LMedS算法\571790_83162e13c41b8d3ca58602dc70eb2b97.zip
目录 0 2002-10-20 17:21 5LMedS算法\Toolbox_Fundamental_matrix\
文件 6559 2002-09-05 16:49 5LMedS算法\Toolbox_Fundamental_matrix\ant_cfnsf.m
文件 2960 2002-09-05 16:45 5LMedS算法\Toolbox_Fundamental_matrix\ant_fnsf.m
文件 1870 2002-09-08 00:45 5LMedS算法\Toolbox_Fundamental_matrix\fummatplot.m
文件 3707 2002-09-08 00:28 5LMedS算法\Toolbox_Fundamental_matrix\funmat7p.m
文件 34856 2002-09-09 11:42 5LMedS算法\Toolbox_Fundamental_matrix\funmatdemo.m
文件 34840 2002-09-09 16:06 5LMedS算法\Toolbox_Fundamental_matrix\funmatdemotest.m
文件 1025 2002-09-08 00:34 5LMedS算法\Toolbox_Fundamental_matrix\funmateig.m
文件 1417 2002-09-08 00:31 5LMedS算法\Toolbox_Fundamental_matrix\funmatError.m
文件 5000 2002-09-08 00:36 5LMedS算法\Toolbox_Fundamental_matrix\funmatFaugeras.m
文件 1598 2002-09-08 00:36 5LMedS算法\Toolbox_Fundamental_matrix\funmatgradeig.m
文件 1603 2002-09-08 00:36 5LMedS算法\Toolbox_Fundamental_matrix\funmatgradls.m
文件 1671 2002-09-08 00:36 5LMedS算法\Toolbox_Fundamental_matrix\funmatilmmdpel.m
文件 49756 2002-09-08 00:36 5LMedS算法\Toolbox_Fundamental_matrix\funmatinmmdpel.m
文件 4074 2002-09-08 00:36 5LMedS算法\Toolbox_Fundamental_matrix\funmatLMedSeig.m
文件 4048 2002-09-08 00:37 5LMedS算法\Toolbox_Fundamental_matrix\funmatLMedSls.m
文件 6714 2002-09-08 00:37 5LMedS算法\Toolbox_Fundamental_matrix\funmatLMedSMest.m
文件 1010 2002-09-08 00:33 5LMedS算法\Toolbox_Fundamental_matrix\funmatls.m
文件 2108 2002-09-08 00:37 5LMedS算法\Toolbox_Fundamental_matrix\funmatMesteig.m
文件 2064 2002-10-04 17:54 5LMedS算法\Toolbox_Fundamental_matrix\funmatMestls.m
文件 2145 2002-09-08 00:37 5LMedS算法\Toolbox_Fundamental_matrix\funmatMestTorr.m
文件 2758 2002-09-08 00:37 5LMedS算法\Toolbox_Fundamental_matrix\funmatnr.m
文件 455 2002-09-08 00:37 5LMedS算法\Toolbox_Fundamental_matrix\funmatrank2.m
文件 3301 2002-10-07 13:03 5LMedS算法\Toolbox_Fundamental_matrix\funmatRANSAC.m
文件 414 2002-09-08 00:41 5LMedS算法\Toolbox_Fundamental_matrix\goodpoints.m
目录 0 2002-10-20 17:21 5LMedS算法\Toolbox_Fundamental_matrix\Imatges\
文件 1761 2000-08-22 15:57 5LMedS算法\Toolbox_Fundamental_matrix\Imatges\calibnoni.dat
文件 1331980 2000-02-18 12:09 5LMedS算法\Toolbox_Fundamental_matrix\Imatges\calibnonia.tif
文件 1331980 2000-02-18 12:41 5LMedS算法\Toolbox_Fundamental_matrix\Imatges\calibnonib.tif
............此处省略69个文件信息
- 上一篇:基于神经网络的人脸识别_检测MATLAB模型
- 下一篇:MATLAB中文用户手册
评论
共有 条评论