0001
0002
0003
0004
0005
0006
0007
0008
0009 addpath(genpath('../General_Functions/'));
0010 addpath('Functions')
0011
0012 close all
0013
0014
0015
0016 init_rand = 6;
0017 type_data = 6;
0018
0019 out_C = 0;
0020
0021
0022
0023 print_type = 0;
0024 plot_type = 0;
0025
0026
0027 ss = plot_init;
0028
0029
0030 init_rand_seed(init_rand);
0031
0032
0033
0034 display('----- Fig. 16.22: Demo finding steps and break lines -----')
0035
0036
0037 [points,BB,delta_x,sigma_k,~,~,dem]=...
0038 simulate_points_dem_6(70,10,10,1,0.00);
0039
0040
0041 type_robust = 0;
0042 out_in = zeros(size(points,1),1);
0043 ds_nonrobust = smooth_dem_robust_bilinear...
0044 (points,BB,delta_x,sigma_k,out_C,type_robust,type_data,out_in,...
0045 print_type,plot_type);
0046
0047
0048 type_robust = 1;
0049 [ds_robust,S,Sigma,Np,Nr,Mc,ver,A,w,w_f,W] = smooth_dem_robust_bilinear...
0050 (points,BB,delta_x,sigma_k,out_C,type_robust,type_data,out_in,...
0051 print_type,plot_type);
0052
0053
0054
0055
0056 figure('name','Fig 16.22 Finding steps and break lines - smoothed dem','color','w',...
0057 'Position',[0.335*ss(1),0.52*ss(2),0.3*ss(1),0.4*ss(2)]);
0058 plot_surface(ds_nonrobust,BB,delta_x,'plotfun',@mesh,'view',[-65,29]);
0059 axis equal
0060 title('smoothed dem','FontSize',16)
0061
0062
0063 figure('name','Fig 16.22 Finding steps and break lines - residuals of smoothed dem','color','w',...
0064 'Position',[0.335*ss(1),0.02*ss(2),0.3*ss(1),0.4*ss(2)]);
0065 imagesc(ds_nonrobust-dem);
0066 colormap(gray);
0067 title('residuals of smoothed dem','FontSize',16)
0068 axis equal; axis off;
0069
0070
0071 figure('name','Fig 16.22 Finding steps and break lines - restored dem','color','w',...
0072 'Position',[0.65*ss(1),0.52*ss(2),0.3*ss(1),0.4*ss(2)]);
0073 plot_surface(ds_robust,BB,delta_x,'plotfun',@mesh,'view',[-65,29]);
0074 axis equal
0075 title('restored dem','FontSize',16)
0076
0077
0078 figure('name','Fig 16.22 Finding steps and break lines - residuals of restored dem','color','w',...
0079 'Position',[0.65*ss(1),0.02*ss(2),0.3*ss(1),0.4*ss(2)]);
0080 imagesc(ds_robust-dem);
0081 colormap(gray);
0082 title('residuals of restored dem','FontSize',16)
0083 axis equal; axis off;