Home > 16-Surface-Reconstruction > Surface-Reconstruction > Functions > simulate_points_dem_0_flat.m

simulate_points_dem_0_flat

PURPOSE ^

% generate a set of points for dem-interpolation

SYNOPSIS ^

function [points,BB,dx,sigma_k,sigma_s,dem,out_in]=simulate_points_dem_0(dx)

DESCRIPTION ^

% generate a set of points for dem-interpolation

 dx   = grid size

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% generate a set of points for dem-interpolation
0002 %
0003 % dx   = grid size
0004 
0005 function [points,BB,dx,sigma_k,sigma_s,dem,out_in]=simulate_points_dem_0(dx)
0006 
0007 
0008 %% Example PCV (do not change)
0009 % bounding box
0010 BB=[-3,-3,14.0,10.0];
0011 
0012 sigma_h = 0.001;
0013 sigma_k = 0.001;
0014 sigma_s = 0.1;
0015 
0016 points = [...
0017      4.0, 4.0, 5,sigma_h;...
0018      2.0, 2.0, 1,sigma_h;...
0019      2.0, 6.0, 1,sigma_h;...
0020      6.0, 2.0, 1,sigma_h;...
0021      6.0, 6.0, 1,sigma_h;...
0022     10.0, 2.0, 3,sigma_h;...
0023     10.0, 6.0, 3,sigma_h ...
0024     ];
0025 points(:,1:2)=points(:,1:2);
0026 out_in=ones(size(points,1),1);
0027 %%
0028 
0029 xmin = BB(1);
0030 ymin = BB(2);
0031 xmax = BB(3);
0032 ymax = BB(4);
0033 Nr = ceil((xmax-xmin)/dx)+1;
0034 Mc = ceil((ymax-ymin)/dx)+1;
0035 %points(:,3)=(points(:,3)-mean(points(:,3)))*sqrt(Nr)/4;
0036 % interpolation kernel
0037 sigma = min(Nr,Mc)/5;
0038 
0039 dem = zeros(Nr,Mc);
0040 for i=1:Nr
0041     for j=1:Mc
0042         dem(i,j)=sum(points(:,3).*...
0043             exp(-1/2*((i-1-(points(:,1)-xmin)/dx).^2+(j-1-(points(:,2)-ymin)/dx).^2)/sigma^2));
0044     end
0045 end
0046 
0047 return

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