% sets all control parameters wf 7/2020 par.BOUND boundary, constant par.init_rand initial random number par.type_data type of image generation par.row, par.col row and column of window in image par.bandwidth 1/bandwidth = average wavelength par.mean_f of image par.sigma_f of image par.K number of generated frequencies par.dx pixel distance (do not change) par.sigma_s maximum change of geometric affinity par.sigma_r maximum change of radiometric affinity par.test_symmetry 0/1: test on symmetry par.warping_routine 0/1: use matplab warping routine imtransform.m par.N_samples number of samples par.plot_type in [0,1,2]: contorl of output par.Nfr half window size of indented overlap par.A_true 3x2, true geometric transformation par.A_a 3x2, approximate geometric transformation par.R_true 1x2, true geometric transformation par.R_a 1x2, approximate geometric transformation par.max_iter maximum number of iterations par.Nf_MIN minimum size of overlap (radius of f) par.S significance level par.sigma_n noise standard deviation par.img_filename image file name stored intermediately par.stg parameters for variance function v=s+t*g par.sth parameters for variance function v=s+t*h par.sigma_smooth smoothing parameter for f par.Diff_filter kernel for bi-cubic interpolation error, constant
0001 function par = simulated_set_parameters(par) 0002 %% sets all control parameters 0003 % 0004 % wf 7/2020 0005 % 0006 % par.BOUND boundary, constant 0007 % par.init_rand initial random number 0008 % par.type_data type of image generation 0009 % par.row, par.col row and column of window in image 0010 % par.bandwidth 1/bandwidth = average wavelength 0011 % par.mean_f of image 0012 % par.sigma_f of image 0013 % par.K number of generated frequencies 0014 % par.dx pixel distance (do not change) 0015 % par.sigma_s maximum change of geometric affinity 0016 % par.sigma_r maximum change of radiometric affinity 0017 % par.test_symmetry 0/1: test on symmetry 0018 % par.warping_routine 0/1: use matplab warping routine imtransform.m 0019 % par.N_samples number of samples 0020 % par.plot_type in [0,1,2]: contorl of output 0021 % par.Nfr half window size of indented overlap 0022 % par.A_true 3x2, true geometric transformation 0023 % par.A_a 3x2, approximate geometric transformation 0024 % par.R_true 1x2, true geometric transformation 0025 % par.R_a 1x2, approximate geometric transformation 0026 % par.max_iter maximum number of iterations 0027 % par.Nf_MIN minimum size of overlap (radius of f) 0028 % par.S significance level 0029 % par.sigma_n noise standard deviation 0030 % par.img_filename image file name stored intermediately 0031 % par.stg parameters for variance function v=s+t*g 0032 % par.sth parameters for variance function v=s+t*h 0033 % par.sigma_smooth smoothing parameter for f 0034 % par.Diff_filter kernel for bi-cubic interpolation error, constant 0035 % 0036 0037 par.BOUND = 3; 0038 0039 % --- initial random number -------------------------------------------- 0040 if par.init_rand <= 0 0041 par.init_rand = 0 0042 end 0043 par.init_rand_prolog = par.init_rand; 0044 par.init_rand_samples = par.init_rand; 0045 par.init_rand_prolog = init_rand_seed(par.init_rand_prolog); 0046 0047 0048 % --- type data -------------------------------------------------------- 0049 0050 if par.type_data < 1 0051 % par.type_data = 1; % 1 square 0052 % par.type_data = 2; % 2 waves 0053 % par.type_data = 3; % 3 MIT-image, subwindow 0054 par.type_data = 4; % 4 smoothed noise 0055 end 0056 0057 par.row=0;par.col=0; 0058 switch par.type_data 0059 case 1 % for square 0060 par.par = [3,0.7]; % size 1/par(1), smoothness of border 0061 par.img_filename = 'square'; % artificial image 0062 case 2 % for waves 0063 par.par = [6,1.5]; % ~number of waves, smoothness of borders 0064 par.img_filename = 'waves2'; % artificial image 0065 case 3 % for position in MIT 0066 %par.col = 182; par.row = 166; 0067 par.col = 114; par.row = 65; 0068 %par.col = 160; par.row = 104; 0069 %par.col = 193; par.row = 207; 0070 par.img_filename = 'MIT.png'; 0071 % row and colum of centre of window (only needed if file is read in 0072 case 4 % degree of smoothing ... 0073 par.bandwidth = 0.12; % 1/bandwidth = average wavelength 0074 par.mean_f = 128; % of image 0075 par.sigma_f = 25; % of image 0076 par.K = 50; % number of generated frequencies 0077 par.dx = 1; % pixel distance (do not change) 0078 par.sigma_s = 0.1; % maximum change of geometric affinity 0079 par.sigma_r = 1; % maximum change of radiometric affinity 0080 0081 par.par(1) = par.bandwidth; 0082 par.par(2) = par.mean_f; 0083 par.par(3) = par.sigma_f; 0084 par.par(4) = par.K; 0085 par.par(5) = par.dx; 0086 par.par(6) = 4; 0087 par.par(7) = par.sigma_s; 0088 par.par(8) = par.sigma_r/255; 0089 par.img_filename = 'random'; % artificial image 0090 end 0091 0092 % --- noisy variance [gr^2] ------------------------------------------- 0093 par.var_n = 8; 0094 par.sigma_n = sqrt(par.var_n); 0095 0096 % --- noise variance = s + t*g (for the range [0,255]) ---------------- 0097 par.stg = [par.var_n ,0]'; 0098 par.sth = [par.var_n ,0]'; 0099 0100 % --- test symmetry, only has an effect if N_samples=1 ----------------- 0101 if par.test_symmetry < 0 0102 par.test_symmetry=1; 0103 end 0104 0105 % --- use warping routine --- 0106 if par.warping_routine < 0; 0107 par.warping_routine = 1; 0108 end 0109 0110 % --- number of samples for checking covariance matrix ----------------- 0111 if par.N_samples <= 0 0112 par.N_samples = 50; 0113 end 0114 0115 if par.test_symmetry==1 0116 par.N_samples = 1; 0117 end 0118 0119 par.plot_type = par.N_samples == 1; 0120 0121 % --- window size ------------------------------------------------------ 0122 par.Nfr = 15; 0123 0124 % -- minimum size of overlap (radius of f) ----------------------------- 0125 par.Nf_MIN = 4; 0126 0127 % ---- Geometric affinity z = A y (! forward) ----------------------- 0128 % par.A_t = [ 2, 0.3, 2;... 0129 % 0.9, 3, 3]; 0130 par.A_t = [ 1.2, 0.05, 0.5;... 0131 0.1, 0.8, 1]; 0132 % par.A_t = [ 1.1, 0.05, 0.5;... 0133 % 0.1, 0.90, -0.5]; 0134 % par.A_t = [ 1.05, 0.05, 0.5;... 0135 % 0.1, 0.94, -0.5]; 0136 % par.A_t = [ 1.0, 0.00, 0.0;... 0137 % 00, 1, 0]; 0138 0139 % specify true and approximate values 0140 par.A_a = par.A_t; 0141 0142 par.R_true = [1.05 10]; 0143 par.R_a = par.R_true; 0144 0145 % adapt to graylevel range [0..1] 0146 par.R_true(2)=par.R_true(2)/255; 0147 0148 % --- smoothing kernel ------------------------------------------------ 0149 par.sigma_smooth = 0; 0150 0151 % --- maximum number of iterations ------------------------------------ 0152 par.max_iter = 7; 0153 0154 % --- significance level ---------------------------------------------- 0155 par.S = 0.999; 0156 0157 % kernel for estimating interpolation error 0158 par.Diff_filter = [ ... 0159 [ 1/65536, -9/32768, 63/65536, 41/16384, 63/65536, -9/32768, 1/65536]; ... 0160 [ -9/32768, 81/16384, -567/32768, -369/8192, -567/32768, 81/16384, -9/32768]; ... 0161 [ 63/65536, -567/32768, 3969/65536, 2583/16384, 3969/65536, -567/32768, 63/65536]; ... 0162 [ 41/16384, -369/8192, 2583/16384, -2415/4096, 2583/16384, -369/8192, 41/16384]; ... 0163 [ 63/65536, -567/32768, 3969/65536, 2583/16384, 3969/65536, -567/32768, 63/65536]; ... 0164 [ -9/32768, 81/16384, -567/32768, -369/8192, -567/32768, 81/16384, -9/32768]; ... 0165 [ 1/65536, -9/32768, 63/65536, 41/16384, 63/65536, -9/32768, 1/65536]]; 0166 0167 end 0168