LMedS算法求解两图像之间的基础矩阵


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_matrixant_cfnsf.m
     文件        2960  2002-09-05 16:45  5LMedS算法Toolbox_Fundamental_matrixant_fnsf.m
     文件        1870  2002-09-08 00:45  5LMedS算法Toolbox_Fundamental_matrixfummatplot.m
     文件        3707  2002-09-08 00:28  5LMedS算法Toolbox_Fundamental_matrixfunmat7p.m
     文件       34856  2002-09-09 11:42  5LMedS算法Toolbox_Fundamental_matrixfunmatdemo.m
     文件       34840  2002-09-09 16:06  5LMedS算法Toolbox_Fundamental_matrixfunmatdemotest.m
     文件        1025  2002-09-08 00:34  5LMedS算法Toolbox_Fundamental_matrixfunmateig.m
     文件        1417  2002-09-08 00:31  5LMedS算法Toolbox_Fundamental_matrixfunmatError.m
     文件        5000  2002-09-08 00:36  5LMedS算法Toolbox_Fundamental_matrixfunmatFaugeras.m
     文件        1598  2002-09-08 00:36  5LMedS算法Toolbox_Fundamental_matrixfunmatgradeig.m
     文件        1603  2002-09-08 00:36  5LMedS算法Toolbox_Fundamental_matrixfunmatgradls.m
     文件        1671  2002-09-08 00:36  5LMedS算法Toolbox_Fundamental_matrixfunmatilmmdpel.m
     文件       49756  2002-09-08 00:36  5LMedS算法Toolbox_Fundamental_matrixfunmatinmmdpel.m
     文件        4074  2002-09-08 00:36  5LMedS算法Toolbox_Fundamental_matrixfunmatLMedSeig.m
     文件        4048  2002-09-08 00:37  5LMedS算法Toolbox_Fundamental_matrixfunmatLMedSls.m
     文件        6714  2002-09-08 00:37  5LMedS算法Toolbox_Fundamental_matrixfunmatLMedSMest.m
     文件        1010  2002-09-08 00:33  5LMedS算法Toolbox_Fundamental_matrixfunmatls.m
     文件        2108  2002-09-08 00:37  5LMedS算法Toolbox_Fundamental_matrixfunmatMesteig.m
     文件        2064  2002-10-04 17:54  5LMedS算法Toolbox_Fundamental_matrixfunmatMestls.m
     文件        2145  2002-09-08 00:37  5LMedS算法Toolbox_Fundamental_matrixfunmatMestTorr.m
     文件        2758  2002-09-08 00:37  5LMedS算法Toolbox_Fundamental_matrixfunmatnr.m
     文件         455  2002-09-08 00:37  5LMedS算法Toolbox_Fundamental_matrixfunmatrank2.m
     文件        3301  2002-10-07 13:03  5LMedS算法Toolbox_Fundamental_matrixfunmatRANSAC.m
     文件         414  2002-09-08 00:41  5LMedS算法Toolbox_Fundamental_matrixgoodpoints.m
     目录           0  2002-10-20 17:21  5LMedS算法Toolbox_Fundamental_matrixImatges
     文件        1761  2000-08-22 15:57  5LMedS算法Toolbox_Fundamental_matrixImatgescalibnoni.dat
     文件     1331980  2000-02-18 12:09  5LMedS算法Toolbox_Fundamental_matrixImatgescalibnonia.tif
     文件     1331980  2000-02-18 12:41  5LMedS算法Toolbox_Fundamental_matrixImatgescalibnonib.tif
............此处省略69个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)