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