0001
0002
0003
0004
0005
0006
0007
0008
0009 clc
0010 close all
0011 clearvars
0012
0013 disp('-------------------------------------------------------------')
0014 disp('Result of exercise 12.9 on conditioning the projection matrix')
0015 disp('-------------------------------------------------------------')
0016
0017
0018 P = [0.0012682807017 -0.0006478859649 0.0003109824561 -0.1611793859649
0019 0.0008165263157 0.0010670263157 0.0001048421052 -2.1127144736842
0020 0.0000002017543 0.0000000350877 0.0000004561403 -0.0008359649122];
0021
0022
0023 disp('Transformation matrix for conditioning image coordinates')
0024 Tx = [1 0 -1500;0 1 -1000;0 0 1500]
0025
0026
0027 disp('Transformation matrix for conditioning object coordinates')
0028 TX = [1 0 0 -500; 0 1 0 -1500;0 0 1 -150; 0 0 0 100]
0029
0030
0031 disp('Conditioned projection matrix')
0032 Pb = (Tx)*P*inv(TX)
0033
0034
0035 disp('Condition number of given projection matrix')
0036 condition_P = cond(P)
0037
0038
0039 disp('Condition number of conditioned projection matrix')
0040 condition_Pb = cond(Pb)
0041
0042 disp('The routine ''cond'' determines the condition number')
0043 disp('of a rectangular matrix from its singular values:')
0044 singular_values = svd(Pb)
0045 condition_number = max(singular_values)/min(singular_values)