Home > 16-Surface-Reconstruction > Profile-Reconstruction > Functions > generate_step_corner.m

generate_step_corner

PURPOSE ^

% generate_step_corner

SYNOPSIS ^

function [x,y,out_in,select,xs,ys] =generate_step_corner(Nd,sigma_e,sigma_n,Pout,Mout,type_out,dens,factor);

DESCRIPTION ^

% generate_step_corner

 [x,y] = generate_step_corner(N,sigma_e,sigma_n);
 
 N         = number of points
 sigma_e   = process noise
 sigma_n   = observation noise
 Pout      = probability for outliers
 Mout      = maximal outlier
 type_out  = type otliers (0=symm., 1=asymm.)
 dens      = density of observed points in (0,1]

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% generate_step_corner
0002 %
0003 % [x,y] = generate_step_corner(N,sigma_e,sigma_n);
0004 %
0005 % N         = number of points
0006 % sigma_e   = process noise
0007 % sigma_n   = observation noise
0008 % Pout      = probability for outliers
0009 % Mout      = maximal outlier
0010 % type_out  = type otliers (0=symm., 1=asymm.)
0011 % dens      = density of observed points in (0,1]
0012 %
0013 
0014 function [x,y,out_in,select,xs,ys] = ...
0015     generate_step_corner(Nd,sigma_e,sigma_n,Pout,Mout,type_out,dens,factor);
0016 
0017 N=3*Nd;
0018 x=zeros(3*Nd,1);
0019 y=zeros(3*Nd,1);
0020 h=ceil(Nd);
0021 
0022 x1=h*ones(Nd,1);
0023 x2=(1:Nd)';
0024 x3=h-x2;
0025 x=3+[x1;x2;x3]*factor;
0026 %x=h*ones(N,1);
0027 y=x+randn(N,1)*sigma_n;
0028 
0029 out_in=zeros(N,1);
0030 m=0;
0031 for i=1:N
0032     if rand(1) < Pout
0033         out_in(i)=1;
0034         if type_out == 0
0035             y(i) = y(i) + 2*(rand(1)-0.5)*Mout;
0036         else
0037             y(i) = y(i) + rand(1)*Mout;
0038         end
0039     end
0040     
0041     if rand(1) < dens
0042         m=m+1;
0043         select(m)=i;
0044         xs(m)=x(i);
0045         ys(m)=y(i);
0046     end
0047 end
0048 
0049 
0050 return
0051 
0052

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