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

fig_16_17_asymmetric_outliers

PURPOSE ^

% Fig. 16.17 page 756

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Fig. 16.17 page 756
 Reconstruction of a profile with one-sided 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.17 page 756
0002 % Reconstruction of a profile with one-sided 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 close all
0009 % clear all
0010 clearvars
0011 
0012 addpath(genpath('../../General-Functions/'));
0013 addpath('Functions')
0014 
0015 
0016 %% plot settings
0017 ss = plot_init;
0018 
0019 disp('----- eliminate asymmetric outliers -----')
0020 
0021 %% set parameters
0022 
0023 % params for generating the data
0024 init_rand = 8;     % may be changed for other example
0025 N = 200;           % number of points
0026 dens = 0.8;        % percentage of observed points in (0,1]
0027 sigma_e = 0.5;     % process noise
0028 sigma_n = 0.5;     % observation noise
0029 Poutlier = 0.4;    % fraction of outliers
0030 Max_outlier = 25;  % max(outlier)
0031 type_outlier = 1;  % asymmetric %type_outlier = 0; % symmetric
0032 
0033 % params for estimation
0034 type_robust  = [1,2,2,2]; %
0035     % 1. [0 = L1, 1 = Kraus,
0036     % 2. g_factor,
0037     % 3. w_factor
0038     % 4. 0,1,2,3 = 00,01,10,11 robust for points and dem
0039 
0040 print_type = 0;
0041 plot_type  = 0;
0042 
0043 Niter = 6;
0044 if type_outlier ==0
0045     factor_sigma = 1;
0046 else
0047     factor_sigma = 8;
0048 end
0049 
0050 
0051 %% initialize random number generation by fixed seed
0052 init_rand_seed(init_rand);
0053 
0054 %% generate profile
0055 [x,y,out_in,select,xs,ys] = ...
0056     generate_observed_AR2(N,sigma_e,sigma_n,Poutlier,Max_outlier,type_outlier,dens);
0057 
0058 
0059 %% reconstruct profile L1
0060 type_robust(1) = 0;
0061 
0062 
0063 xest = estimate_profile_robust...
0064     (N,select,ys,sigma_e/factor_sigma,sigma_n,Niter,type_outlier,...
0065     type_robust,print_type,plot_type);
0066 
0067 
0068 %% reconstruct profile Kraus
0069 type_robust(1) = 1;
0070 factor_sigma= 1;
0071 
0072 xest_kraus = estimate_profile_robust...
0073     (N,select,ys,sigma_e/factor_sigma,sigma_n,Niter,type_outlier,...
0074     type_robust,print_type,plot_type);
0075 
0076 
0077 %% plot
0078 figure('name','Fig. 16.17: Reconstruction of a profile with one-sided outliers',...
0079     'color','w', 'Position',[0.2*ss(1),0.1*ss(2),0.4*ss(1),0.8*ss(2)]);
0080 
0081 subplot(2,1,1);hold on
0082 plot(1:N,x,'--r','LineWidth',3)
0083 plot(1:N,xest,'-k','LineWidth',2)
0084 plot(select,ys,'.b','MarkerSize',20)
0085 xlabel('$x$');ylabel('$z$');
0086 title('Fig. 16.17a: Reconstruction with one-sided $L_{12}$-weight function');
0087 
0088 subplot(2,1,2);hold on
0089 plot(select,ys,'.b','MarkerSize',20)
0090 plot(1:N,x,'--r','LineWidth',3)
0091 plot(1:N,xest_kraus,'-k','LineWidth',2)
0092 xlabel('$x$');ylabel('$z$');
0093 title(['Fig. 16.17b: Reconstruction with the weight function of Kraus and Pfeifer,' ...
0094     ' $g = ', num2str(type_robust(2)),', w = ',num2str(type_robust(3)),'$']);
0095 
0096

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