Home > 16-Surface-Reconstruction > Profile-Reconstruction > fig_16_15_symmetric_outliers.m

fig_16_15_symmetric_outliers

PURPOSE ^

% Fig. 16.15 page 755

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Fig. 16.15 page 755
 test profile smoothing with symmetric outliers

 Wolfgang Förstner 2014-08-06
 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.15 page 755
0002 % test profile smoothing with symmetric outliers
0003 %
0004 % Wolfgang Förstner 2014-08-06
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 %% plot settings
0014 ss = plot_init;
0015 
0016 disp('----- eliminate symmetric outliers -----')
0017 
0018 %% set parameters
0019 
0020 % params for generating the data
0021 init_rand = 8;     % may be changed for other example
0022 N = 200;           % number of points
0023 dens = 0.8;        % percentage of observed points in (0,1]
0024 sigma_e = 0.5;     % process noise
0025 sigma_n = 0.5;     % observation noise
0026 Poutlier = 0.4;    % fraction of outliers
0027 Max_outlier = 25;  % max number of outliers
0028 type_outlier = 0;  % symmetric  %type_outlier = 1; % asymmetric
0029 
0030 % params for estimation
0031 type_robust  = [0,2,2,2]; %
0032     % 1. [0 = L1, 1 = Kraus,
0033     % 2. g_factor,
0034     % 3. w_factor
0035     % 4. 0,1,2,3 = 00,01,10,11 robust for points and dem
0036 
0037 print_type = 0;
0038 plot_type  = 0;
0039 
0040 if type_outlier ==0
0041     Niter = 6;
0042     factor_sigma = 1;
0043 else
0044     Niter = 3;
0045     factor_sigma= 8;
0046 end
0047 
0048 
0049 %% initialize random number generation by fixed seed
0050 init_rand_seed(init_rand);
0051 
0052 %% generate profile
0053 [x,y,out_in,select,xs,ys] = ...
0054     generate_observed_AR2(N,sigma_e,sigma_n,Poutlier,Max_outlier,type_outlier,dens);
0055 
0056 %% reconstruct profile
0057 [xest,A,ver,weights,Cov] = ...
0058     estimate_profile_robust...
0059     (N,select,ys,sigma_e/factor_sigma,sigma_n,Niter,type_outlier,...
0060     type_robust,print_type,plot_type);
0061 
0062 
0063 figure('name','Fig. 16.15 Reconstruction of profile with outliers','color','w',...
0064     'Position',[0.2*ss(1),0.2*ss(2),0.5*ss(1),0.5*ss(2)]);
0065 hold on;
0066 plot(1:N,x,'--r','LineWidth',3)
0067 plot(1:N,xest,'-k','LineWidth',3)
0068 plot(select,ys,'.b','MarkerSize',20)
0069 
0070 title = (['Fig. 15.15: $N = ',num2str(N),'$, density $= ',num2str(dens),...
0071     '$, $s_e = ',num2str(sigma_e),'$, $s_n = ',num2str(sigma_e),...
0072     '$, $P($outlier$) = ',num2str(Poutlier),'$, $\max($outlier$) = ',num2str(Max_outlier),...
0073     '$, Niter$ = ',num2str(Niter),'$']);
0074 xlabel('$x$');ylabel('$z$');
0075

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