资源简介
matlab算法计算三维散乱点云的曲率,包括主曲率,高斯曲率和平均曲率
代码片段和文件信息
function [output_gaussian output_mean output_k1 output_k2] = MLS_curvature_computing(input_pnts input_normals eval_pnts number_of_neighbor gaussian_param)
% Direct computing of point-set surface curvatures
%
% [out_a out_b out_c out_d] = MLS_curvature_computing (in_1 in_2 in_3 in_4 in_5)
%
% Description :
% Direct computing of surface curvatures for point-set surfaces based on
% a set of analytical equations derived from MLS.
%
% Parameters [IN ]:
% in_1 : input synthetic/real point data which will define an MLS surface
% in_2 : corresponding normals of the input synthetic/real point data
% in_3 : positions where to evaluate surface curvatures
% in_4 : number of neighbor points which will contribute to the curvature
% computing at each evaluation position
% in_5 : Gaussian scale parameter that determines the width of the Gaussian
% kernel
%
% Returns [ OUT ]:
% out_a : output gaussian curvatures
% out_b : output mean curvatures
% out_c : output maximum principal curvatures
% out_d : output minimum principal curvatures
%
% Example :
% see the demo
%
% References :
% Yang P. and Qian X. “Direct computing of surface curvatures for
% point-set surfaces“ Proceedings of 2007 IEEE/Eurographics Symposium
% on Point-based Graphics(PBG) Prague Czech Republic Sep. 2007.
%
% Authors : Pinghai Yang
% Created : Sep. 25 2007
% Version : 1.0
% Matlab Version : 7.0 ( Windows )
%
% Copyright (c) 2007 CDM Lab Illinois Institute of Technology U.S.A.
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Output Gaussian curvature
output_gaussian = zeros(size(eval_pnts2)size(eval_pnts3));
% Output Mean curvature
output_mean = zeros(size(eval_pnts2)size(eval_pnts3));
for i = 1:size(eval_pnts2)
for j = 1:size(eval_pnts3)
% Coordinates of the current point
eval_pnt = eval_pnts(:ij);
neighbor_index = nearestneighbour(eval_pnt input_pnts ‘NumberOfNeighbours‘ number_of_neighbor);
neighbor_pnts = input_pnts(:neighbor_index);
% Difference vectors from neighbor points to the evaluation point
diff_vec = repmat(eval_pnt 1 number_of_neighbor) - neighbor_pnts;
dist_squared = diff_vec(1:).*diff_vec(1:) + diff_vec(2:).*diff_vec(2:) + diff_vec(3:).*diff_vec(3:);
weight = exp(- dist_squared / gaussian_param^2);
% Delta_g of the current point
neighbor_normals = input_normals(:neighbor_index);
for ii = 1:3
eval_normal(ii1) = sum(weight.*neighbor_normals(ii:));
end
normalized_eval_normal = eval_normal/norm(eval_normal);
projected_diff_vec = diff_vec(1:).*normalized_eval_normal(11) + diff_vec(2:).*normalized_eval_normal(21)...
+ diff_vec(3:).*normalized_eval_normal(31);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%delta_g
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2007-10-04 20:55 demo_MLS
文件 8400 2007-09-30 00:55 demo_MLS\demo_evaluation_data.txt
文件 281617 2007-09-30 00:55 demo_MLS\demo_input_data.txt
文件 11647 2007-09-30 01:18 demo_MLS\demo_resulting_curvatures.txt
文件 7484 2007-09-30 01:16 demo_MLS\MLS_curvature_computing.m
文件 1854 2007-09-30 01:27 demo_MLS\MLS_demo.m
文件 1182 2007-09-30 01:29 demo_MLS\MLS_energy.asv
文件 1196 2007-09-30 01:29 demo_MLS\MLS_energy.m
文件 2000 2007-09-30 01:29 demo_MLS\MLS_projection.asv
文件 2000 2007-09-30 01:31 demo_MLS\MLS_projection.m
文件 9365 2006-11-14 23:30 demo_MLS\nearestneighbour.m
文件 975 2007-09-30 01:37 demo_MLS\readme.txt
----------- --------- ---------- ----- ----
327938 13
评论
共有 条评论