source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/zisserman/vgg_multiview/private/vgg_singF_from_FF.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

  • Property svn:executable set to *
File size: 769 bytes
Line 
1%VGG_SINGF_FROM_FF  Linearly combines two 3x3 matrices to a singular one.
2%
3%   a = vgg_singF_from_FF(F)  computes scalar(s) a such that given two 3x3 matrices F{1} and F{2},
4%   it is det( a*F{1} + (1-a)*F{2} ) == 0.
5
6function a = vgg_singF_from_FF(F)
7
8% precompute determinants made from columns of F{1}, F{2}
9for i1 = 1:2
10  for i2 = 1:2
11    for i3 = 1:2
12      D(i1,i2,i3) = det([F{i1}(:,1) F{i2}(:,2) F{i3}(:,3)]);
13    end
14  end
15end
16
17% Solve The cubic equation for a
18a = roots([-D(2,1,1)+D(1,2,2)+D(1,1,1)+D(2,2,1)+D(2,1,2)-D(1,2,1)-D(1,1,2)-D(2,2,2)
19            D(1,1,2)-2*D(1,2,2)-2*D(2,1,2)+D(2,1,1)-2*D(2,2,1)+D(1,2,1)+3*D(2,2,2)
20            D(2,2,1)+D(1,2,2)+D(2,1,2)-3*D(2,2,2)
21            D(2,2,2)]);
22a = a(abs(imag(a))<10*eps);
23
24return
Note: See TracBrowser for help on using the repository browser.