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

fig_16_22_demo_robust_surface_reconstruction

PURPOSE ^

% Fig. 16.22 page 762

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Fig. 16.22 page 762
 Robust surface reconstruction
 Uwe Weidner's test image (ECCV, 1994)

 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.22 page 762
0002 % Robust surface reconstruction
0003 % Uwe Weidner's test image (ECCV, 1994)
0004 %
0005 % Wolfgang Förstner 07/14
0006 % last changes: Susanne Wenzel 09/16
0007 % wfoerstn@uni-bonn.de, wenzel@igg.uni-bonn.de
0008 
0009 addpath(genpath('../General_Functions/'));
0010 addpath('Functions')
0011 
0012 close all
0013 
0014 %% set parameters
0015 
0016 init_rand = 6;             % init random generator - may be changed for other example
0017 type_data = 6;             % @todo: kann weg?
0018 
0019 out_C = 0;    % 0 no covariance matrix as output
0020               % 1 covariance matrix as output
0021 
0022 % output settings
0023 print_type = 0;
0024 plot_type  = 0;
0025 
0026 %% plot settings
0027 ss = plot_init;
0028 
0029 %% initialize random number generation by fixed seed
0030 init_rand_seed(init_rand);
0031 
0032 %% ---------------------- LETS GO -----------------------------------------
0033 
0034 display('----- Fig. 16.22: Demo finding steps and break lines  -----')
0035 
0036 %% generate dem point cloud
0037 [points,BB,delta_x,sigma_k,~,~,dem]=...
0038     simulate_points_dem_6(70,10,10,1,0.00);
0039 
0040 %% smooth non-robust
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 %% smooth robust
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 %% plot
0054 
0055 % plot smoothed surface
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 % plot residuals
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 % plot restored dem
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 % plot residuals
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;

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