0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 close all
0017 clearvars
0018
0019
0020 addpath(genpath('src/'))
0021
0022 disp(' --------------------------------------------------------------------- ')
0023 disp(' ---- Symmetric LSM with 6 geometric and 2 radiometric parameters ---- ')
0024 disp(' ----------------- two corresponding windows ------------------------- ')
0025 disp(' --- with given approximate values and noise characteristics --------- ')
0026 disp(' --------------------------------------------------------------------- ')
0027
0028 plot_type = 1;
0029 max_iter = 7;
0030 sigma_smooth = 0;
0031 Nf_MIN = 4;
0032
0033
0034
0035 load('example_data/Sym_LSM_small_demo');
0036
0037
0038
0039
0040
0041
0042 g=double(g);
0043 h=double(h);
0044 figure('name','given image patches')
0045 hold on
0046 subplot(1,2,1)
0047 imshow(g/255);
0048 title('left image')
0049 subplot(1,2,2)
0050 imshow(h/255);
0051 title('right image')
0052
0053
0054 disp( 'Approximate geometric transformation affinity zh = Ah yh: ')
0055 disp(A_a);
0056
0057 disp(['Approximate intensity transformation h = R1*y + R2 [gr] : [',...
0058 num2str(R_a(1)),',',num2str(R_a(2)*255),']'])
0059
0060
0061 disp(['Maximum number of iterations : ', num2str(max_iter)])
0062
0063
0064 disp(['Minimum size of overlap : ', num2str(Nf_MIN),'x', num2str(Nf_MIN)])
0065
0066
0067 disp(['Smoothing kernel [pixels] : 0'])
0068
0069
0070 figure('name','noise standard deviations');
0071 hold on
0072 plot(sqrt(vg),'-b','LineWidth',2);
0073 plot(sqrt(vh),'-r','LineWidth',2);
0074 title('Noise standard deviations: left (blue), right(red)')
0075 xlim([0,255])
0076 ylim([0,1.1*max([sqrt(vg);sqrt(vh)])])
0077
0078
0079
0080 disp('=== Iteration sequence =======================================')
0081
0082 [est_x,est_sigma_0,NN,Nf,Red,N_iter] = LSM_62_sym_warp_main...
0083 (g,h,vg,vh,A_a,R_a,sigma_smooth,max_iter,Nf_MIN,1);
0084
0085
0086 A_est = [reshape(est_x.x(1:6),2,3);0 0 1];
0087 Rm_est = [ est_x.x(7:8)';0 1];
0088 Ai_est = A_est;
0089
0090 image_pair_analyse(...
0091 A_a, ...
0092 R_a, ...
0093 Ai_est, ...
0094 Red, ...
0095 est_sigma_0, ...
0096 est_x, ...
0097 1,0);
0098
0099 disp(' --------------------------------- ')
0100 disp(' ---- end demo symmetric LSM ---- ')
0101 disp(' --------------------------------- ')
0102
0103