0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 function [points,BB,delta_x,sigma_k,XYZ_ori]=simulate_points_dem_10(file_name,Nbin)
0023
0024
0025 ss = plot_init;
0026
0027
0028 pts = ply_read(file_name);
0029
0030
0031 XYZ_ori = [pts.vertex.x,pts.vertex.y,pts.vertex.z];
0032 N = size(XYZ_ori,1);
0033
0034
0035
0036
0037
0038
0039
0040
0041 XYZ = XYZ_ori;
0042
0043
0044 xmin = min(XYZ(:,1));
0045 xmax = max(XYZ(:,1));
0046 ymin = min(XYZ(:,2));
0047 ymax = max(XYZ(:,2));
0048 frame_size = 1.1;
0049 bord = (frame_size-1)/2;
0050 Range_x = (xmax-xmin);
0051 Range_y = (ymax-ymin);
0052 delta_x = min(Range_x,Range_y)/(Nbin-1);
0053 Nr = ceil(Range_x*frame_size/delta_x);
0054 Mc = ceil(Range_y*frame_size/delta_x);
0055 BB = [xmin-bord*Range_x, ymin-bord*Range_y,...
0056 xmin-bord*Range_x+(Nr-1)*delta_x,ymin-bord*Range_y+(Mc-1)*delta_x];
0057
0058
0059 factor_n = 0.1;
0060 sigma_n = factor_n*max([Range_x,Range_y])/sqrt(N);
0061 sigma_k = 3.0 * sigma_n;
0062
0063
0064 points = [XYZ(:,1),XYZ(:,2),XYZ(:,3),sigma_n*ones(N,1)];
0065
0066
0067 figure('name','Given points','color','w',...
0068 'Position',[0.1*ss(1),0.3*ss(2),0.3*ss(1),0.4*ss(2)]);
0069 plot3(points(:,1),points(:,2),points(:,3),'.k')
0070 axis equal;axis off;hold on
0071 xlabel('x');ylabel('y');zlabel('z');
0072 view([0,90])
0073 title('Given points')
0074 plot3([BB(1),BB(1),BB(3),BB(3),BB(1)],[BB(2),BB(4),BB(4),BB(2),BB(2)],[0,0,0,0,0],'-k');
0075
0076
0077
0078
0079 return