Home > 16-Surface-Reconstruction > Surface-Reconstruction > 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 plot_init;
0012 
0013 close all
0014 
0015 %% set parameters
0016 
0017 init_rand = 6;             % init random generator - may be changed for other example
0018 
0019 out_C = 0;    % 0 no covariance matrix as output
0020               % 1 covariance matrix as output
0021 
0022 % output settings
0023 print_type = 1;
0024 plot_type  = 1;
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 disp('-----------------------------------------------------------')
0035 disp('----- Fig. 16.22: Demo finding steps and break lines  -----')
0036 disp('-----------------------------------------------------------')
0037 
0038 %% generate dem point cloud
0039 % [points,BB,delta_x,sigma_k,out_in,dem]=...
0040 %     simulate_points_dem_6(70,10,10,1,0.00);
0041 
0042 [points,BB,delta_x,sigma_k,out_in,dem]=...
0043     simulate_points_dem_6(70,10,10,1,0.00);
0044 
0045 %% smooth dem non-robustly
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 %% smooth dem robustly
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 %% plot
0062 
0063 % plot smoothed surface
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 % plot residuals
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 % plot restored dem
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 % plot residuals
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;

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