资源简介
MATLAB 三维点云重构Surface recostruction from scattered points cloud
MyCrust090209(matlab).zip
代码片段和文件信息
%% MyCrust
%
%Simple surface recostruction program based on Crust algorithm Given a set
% of 3D points returns a triangulated tight surface.
%
%The more points there are the best the surface will be fitted although
% you will have to wait more. For very large models an help memory errors
% may occurs. It is important even the point distribution generally
% uniformly distributed points with denser zones in high curvature features
% give the best results.
%
%Remember crust algorithom needs a cloud representing a VOLUME so open
% surface may give inaccurate results. Surface with small holes are not
% considered open surface and generally are processed well.
%
%
% If any problems occurs in execution or if you found a bug have a
% suggestion or question just contact me at:
%
% giaccariluigi@msn.com
%
%
%
%
%Here is a simple example:
%
%load Dino.mat%load input points from mat file
%
%[t]=MyCrust(p);
%
% figure(1)
% hold on title(‘Output Triangulation‘‘fontsize‘14) axis equal
% trisurf(tp(:1)p(:2)p(:3)‘facecolor‘‘c‘‘edgecolor‘‘b‘)
%
%Input:
% p is a Nx3 array containing the 3D set of points
%Output:
% t are points id contained in triangles nx3 array .
%
% See also qhull voronoin convhulln delaunay delaunay3 tetramesh.
%
%Author:Giaccari Luigi
%Last Update: 03/1/2008
%Created: 10/10/2008
function [t]=MyCrust(p)
%error check
if nargin>1
error(‘The only input must be the Nx3 array of points‘);
end
[n]=size(p2);
if n ~=3
error(‘Input 3D points must be stored in a Nx3 array‘);
end
clear n
%% Main
starttime=clock;
%add points to the given ones this is usefull
%to create outside tetraedroms
tic
[pnshield]=AddShield(p);
fprintf(‘Added Shield: %4.4f s\n‘toc)
tic
tetr=delaunayn(p);%creating tedraedron
tetr=int32(tetr);%use integer to save memory
fprintf(‘Delaunay Triangulation Time: %4.4f s\n‘toc)
%connectivity data
%find triangles to tetraedrom and tetraedrom to triangles connectivity data
tic
[t2tetrtetr2tt]=Connectivity(tetr);
fprintf(‘Connectivity Time: %4.4f s\n‘toc)
tic
[ccr]=CC(ptetr);%Circumcenters of tetraedroms
fprintf(‘Circumcenters Time: %4.4f s\n‘toc)
clear n
tic
tbound=Marking(ptetrtetr2tt2tetrccrnshield);%Flagging tetraedroms as inside or outside
fprintf(‘Walking Time: %4.4f s\n‘toc)
%recostructed raw surface
t=t(tbound:);
time=etime(clockstarttime);
fprintf(‘Total Time: %4.4f s\n‘time)
end
%% Circumcenters
function [ccr]=CC(ptetr)
%finds circumcenters from a set of tetraedroms
%points of tetraedrom
p1=(p(tetr(:1):));
p2=(p(tetr(:2):));
p3=(p(tetr(:3):));
p4=(p(tetr(:4):));
%vectors of tetraedrom edges
v21=p(tetr(:1):)-p(tetr(:2):);
v31=p(tetr(:3):)-p(tetr(:1):);
v41=p(tetr(:4):)-p(tetr(:1):);
%preallocation
cc=zeros(size(tetr1)3);
%Solve the system using cramer method
d1=s
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2009-02-09 23:08 MyCrust090209\
文件 67998 2007-04-13 18:57 MyCrust090209\Beethoven.mat
文件 45713 2008-11-20 23:01 MyCrust090209\Block.mat
文件 1100582 2008-11-20 23:13 MyCrust090209\Chair.mat
文件 550432 2008-11-20 23:05 MyCrust090209\Elephant.mat
文件 290952 2008-07-02 00:24 MyCrust090209\gargo50k.mat
文件 188902 2008-06-28 20:52 MyCrust090209\hippo.mat
文件 985815 2008-11-20 23:13 MyCrust090209\Horse.mat
文件 218573 2009-01-05 18:37 MyCrust090209\Knot.mat
文件 12438 2009-02-09 22:48 MyCrust090209\MyCrust.m
文件 358743 2009-01-05 18:46 MyCrust090209\OilPump.mat
文件 306544 2008-11-20 23:11 MyCrust090209\Skull.mat
文件 804127 2008-11-20 23:10 MyCrust090209\Standford_Bunny.mat
文件 953 2009-02-09 23:14 MyCrust090209\TestMyCrust.m
文件 1121230 2009-01-22 23:46 MyCrust090209\Vertebra1.mat
文件 1335 2009-05-18 18:13 license.txt
相关资源
- 数学建模的29个通用模型及matlab解法
- 用matlab实现视频水印
- mean shift 目标跟踪matlab程序
- 船舶运动控制Matlab
- 通信工程毕业设计论文外文翻译-扩频
- 电磁场计算方法与MATLAB实现
- 基于Matlab的遥感影像BP神经网络分类算
- 基于MATLAB GUI的数字图像处理
- matlab中文帮助文档免费
- 时频工具箱
- matlab三维网格化图像源码
- BLDC matlab建模
- matlab图片内容查重检测
- 自适应滤波算法的matlab实现
- 常见通信信道建模与仿真MATLAB)
- 使用Matlab7.3开发的使用整数小波变换
- matlab图像处理详解杨丹源代码
- 基于MATLAB的语音共振峰的估计
- 1维的简单LDA和2维LDA人脸识别的matla
- 基于MATLAB的人脸识别
- 图像配准技术及其MATLAB编程实现源码
- 语音识别算法matlab 源代码!完整!可
- 精通matlabpdf版
- 基于MATLAB软件读取Rinex3.02版本观测文
- MATLAB R2016a完全自学一本通_配套源文件
-
simuli
nk仿真及代码生成的模型程序文 - MATLAB与控制系统仿真实践第3版2015b
- 电力系统潮流计算MATLAB课程设计
- 9-JPEG2000编码方式的MATLAB实现+原理讲解
- MATLAB数字水印 源代码+毕业论文
评论
共有 条评论