Home > 16-Surface-Reconstruction > Surfacereconstruction > fig_16_9b_demo_surface_reconstruction.m

fig_16_9b_demo_surface_reconstruction

PURPOSE ^

% Fig. 16.9 bottom page 740

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Fig. 16.9 bottom page 740
 Reconstruct dem from 7 points with flattening and smoothing

 Wolfgang Förstner 01/15
 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.9 bottom page 740
0002 % Reconstruct dem from 7 points with flattening and smoothing
0003 %
0004 % Wolfgang Förstner 01/15
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 % data generation
0016 init_rand = 6;             % init random generator - may be changed for other example
0017 type_data = 11;
0018 
0019 % smoothing
0020 type_robust = 0;
0021 %             0 not robust
0022 %             1 only dem
0023 %             2 only points
0024 %             3 both
0025 out_C = 0;    % 0 no covariance matrix as output
0026               % 1 covariance matrix as output
0027 
0028 % intermediate output
0029 print_type = 0;
0030 plot_type  =0;
0031 
0032 
0033 %% plot settings
0034 ss = plot_init;
0035 
0036 %% initialize random number generation by fixed seed
0037 init_rand_seed(init_rand);
0038 
0039 
0040 %% ---------------------- LETS GO -----------------------------------------
0041 
0042 display('----- demo reconstruct dem from 7 points with flattening and smoothing -----')
0043 
0044 %% generate dem point cloud
0045 [points,BB,delta_x,sigma_k,sigma_s,dem,out_in] = simulate_points_dem_0_flat;
0046    
0047 
0048 %% interpolate flat
0049 starttime_flattening = cputime;
0050 ds_flat = smooth_dem_robust_bilinear_flat...
0051     (points,BB,delta_x,sigma_k,out_C,type_robust,type_data,...
0052     out_in,print_type,plot_type);
0053 
0054 display(['      time for solution flattening: ',num2str(cputime-starttime_flattening)])
0055 
0056 %% interpolate smooth
0057 starttime_smoothing = cputime;
0058 ds_smooth = smooth_dem_robust_bilinear...
0059     (points,BB,delta_x,sigma_k,out_C,type_robust,type_data,...
0060     out_in,print_type,plot_type);    
0061     
0062 display(['      time for solution smoothing: ',num2str(cputime-starttime_smoothing)])
0063 
0064 
0065 %% plot
0066 figure('name','Fig 16.9 bottom: Best fitting 2D function','color','w',...
0067     'Position',[0.1*ss(1),0.2*ss(2),0.8*ss(1),0.5*ss(2)]);
0068 
0069 subplot(1,2,1);hold on;
0070 plot_surface(ds_flat,BB,delta_x,'EdgeColor','none','FaceLighting','gouraud',...
0071         'ColorFct','smoothtanh','shading','interp','alpha',0.3,'view',[-20,30]);
0072 plot3(points(:,1),points(:,2),points(:,3),'.b','MarkerSize',15);
0073 axis equal
0074 title('flat dem with given points','FontSize',16)
0075 
0076 subplot(1,2,2);hold on
0077 plot_surface(ds_smooth,BB,delta_x,'EdgeColor','none','FaceLighting','gouraud',...
0078         'ColorFct','smoothtanh','shading','interp','alpha',0.3,'view',[-20,30]);   
0079 plot3(points(:,1),points(:,2),points(:,3),'.b','MarkerSize',15)
0080 axis equal
0081 title('smooth dem with given points','FontSize',16)
0082   
0083 
0084

Generated on Mon 08-Jan-2018 17:21:49 by m2html © 2005