Home > 16-Surface-Reconstruction > Surface-Reconstruction > fig_16_20_demo_surface_reconstruction.m

fig_16_20_demo_surface_reconstruction

PURPOSE ^

% Fig. 16.20 page 761

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Fig. 16.20 page 761
 Surface reconstruction: test dem smoothing, plots of sparse matrices A, N etc.

 Wolfgang Förstner 07/14
 last changes: Susanne Wenzel 09/16
 wfoerstn@uni-bonn.de, wenzel@igg.uni-bonn.de

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% Fig. 16.20 page 761
0002 % Surface reconstruction: test dem smoothing, plots of sparse matrices A, N etc.
0003 %
0004 % Wolfgang Förstner 07/14
0005 % last changes: Susanne Wenzel 09/16
0006 % wfoerstn@uni-bonn.de, wenzel@igg.uni-bonn.de
0007 
0008 addpath(genpath('../../General-Functions/'));
0009 addpath('Functions')
0010 
0011 close all
0012 
0013 %% set parameters
0014 
0015 % params for generating the data
0016 init_rand = 6;            % seed for random generator - may be changed for other example
0017 
0018 % smoothing
0019 type_robust = 0;
0020 %             0 not robust
0021 %             1 only dem
0022 %             2 only points
0023 %             3 both
0024 out_C = 1;    % 0 no covariance matrix as output
0025               % 1 covariance matrix as output
0026 
0027 % output settings
0028 print_type = 0;
0029 plot_type  = 0;
0030 
0031 %% initialize random number generation by fixed seed
0032 init_rand_seed(init_rand);
0033 
0034 %% ---------------------- LETS GO -----------------------------------------
0035 
0036 disp('----- Fig. 16.20: Demo surface interpolation -----')
0037 
0038 %% generate dem point cloud
0039 [points,BB,delta_x,sigma_k,sigma_h,out_in,dem] = simulate_points_dem_0;
0040 
0041 %% interpolate
0042 
0043 [ds,S,Sigma,Np,Nr,Mc,ver,A,w,w_f,W] = smooth_dem_robust_bilinear...
0044     (points,BB,delta_x,sigma_k,out_C,type_robust,out_in,...
0045     print_type,plot_type);
0046 
0047 
0048 %% plot
0049 
0050 % plot settings
0051 ss = plot_init;
0052 
0053 % plot surface and points
0054 figure('name','Fig 16.20 Demo surface interpolation','color','w',...
0055     'Position',[0.1*ss(1),0.2*ss(2),0.7*ss(1),0.6*ss(2)]);
0056 
0057 subplot(1,2,1);hold on
0058 plot_surface(ds,BB,delta_x,'alpha',0.3,'view',[-29,65],'colormap','cool');
0059 for n=1:Np
0060     plot3(points(n,1),points(n,2),points(n,3),'.k','MarkerSize',15)
0061 end
0062 axis equal
0063 xlabel('$x$');ylabel('$y$');zlabel('$z$');
0064 title('Fitted surface','FontSize',16)
0065 
0066 % plot standarddeviation
0067 subplot(1,2,2);hold on
0068 plot_surface(sqrt(S),BB,delta_x,'alpha',0.3,'view',[-29,65],'colormap','cool');
0069 z=zeros(Np,1);
0070 for n=1:Np
0071     z(n)=interpolate_bilinear(S,points(n,1),points(n,2),delta_x,BB,sigma_h);
0072     plot3(points(n,1),points(n,2),sqrt(z(n)),'.k','MarkerSize',15) 
0073 end
0074 plot3(0,0,0,'.k')
0075 axis equal
0076 xlabel('$x$');ylabel('$y$');zlabel('$\sigma_z$');
0077 title('Standard deviations $\sigma_z$ of the estimated grid points','FontSize',16)
0078 
0079 
0080

Generated on Sat 21-Jul-2018 20:56:10 by m2html © 2005