Matlab code

profileCirrus Hazard
exp_batch_motion_fusion.m

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Fuse the registered displacement vector field Ud and Uc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function exp_batch_motion_fusion(varargin) path(path,'../'); % path(path,'../_Common_Image_Data'); %== Parameter set ================================================= % m=513; % n=513; m = 65; n = 65; dataname = 'R'; % Multiresolution starting level Multi_SL = 1; % level 1: knot space hx, hy == 2^0 == 1 ite_max_h = 800; % load T; % 513x513 hurricane image % load R; load R_h8; % 129x129 hurricane image load T_h8; T = double(T); R = double(R); % Normalize T, R, making SSD of T, R = 2000 norm_factor = sqrt(2000/sum((R(:)-T(:)).^2)); T = T * norm_factor; R = R * norm_factor; % for noise addition SNR_dB = 100; % multi-resolution, interp f to compute gradient or not interp_f = 1; deform_case = 1; % Using deformation method case 1, 2 % Solver method: FCD: 0, LSFEM: 1 solver_method = 0; bd_cond = 0; % 0: dirichlet, 1: neumann % LSFEM grid size*2+1: 0, LSFEM full size*2+1: 1, 17x17: 2 solver_sz = 1; regrid = 0; % Fix Jacobian fix_f1 = 0; % Euler:0, Mid: 1, RK4: 2 RK_method = 0; RK_steps = 1; % f1, f2 dt, seperately: 1 simultaneously: 0 dt_f1f2 = 0; groundT = 0; tstep = 10^(0); maskT = ones(m,n); truth_x = zeros(m,n); truth_y = zeros(m,n); th_low = 0.1; th_high = 10; filename = ['results/case',num2str(deform_case),'_2d_',dataname,... '_interpf',num2str(interp_f),'_bdcond',num2str(bd_cond),'_SNRdB',num2str(SNR_dB),... '_regrid',num2str(regrid),'_fixJ',num2str(fix_f1),... '_solver_method',num2str(solver_method),... '_RKmethod',num2str(RK_method),'_RKsteps',num2str(RK_steps),'_h']; %========================================================= % Registration %========================================================= tic; [T_deformed, Phi_Xd, Phi_Yd] = ... case1_preprocess(filename, T, R, solver_method, solver_sz, ... RK_method, RK_steps, Multi_SL, ... maskT, regrid, truth_x, truth_y, tstep, th_low, th_high, fix_f1, ... bd_cond, deform_case, dt_f1f2, ite_max_h, dataname); total_time = toc if Multi_SL > 2 filename_tmp = [filename,'4x4']; save(filename_tmp, 'total_time','-append'); movefile([filename_tmp,'.mat'],... [filename(1:end-2),'_ite_', ite_max_h, '_h',2^(Multi_SL-1),'-h4.mat']); try delete([filename,'8x8.mat']); delete([filename,'16x16.mat']); delete([filename,'32x32.mat']); delete([filename,'64x64.mat']); catch end end end