matlab最小包围盒

收录时间:2014-11-10
资源分类:Matlab 工具:MATLAB 7.5 (R2007b)

这个函数很容易计算三维中最小的盒子(直角)围绕一个点集。
盒子的极值性质确定数量的总和,边或表面的长度。
该计算是基于启发式,但数量巨大的试验并没有显示出任何反例。
在函数的算法分为三个水平的精度,具有不同的运行时间。

Minimal Bounding Box

With this function one can easily compute the minimal box (with right angles) around a set of points in 3d.

 

The extremal property of the box is determined either in terms of volume, surface or sum of edgelengths.

 

The calculation is based on heuristics only, but a huge number of tests did not show any counterexamples yet.

 

The algorithm behind the function is subdivided into three levels of accuracy with differing runtimes.

 

x = rand(10000,1);

y = rand(10000,1);

z = rand(10000,1);

 

tic;[rotmat,cornerpoints,volume,surface] = minboundbox(x,y,z,'v',3);toc

Elapsed time is 10.772170 seconds.

 

volume =

    0.9993

surface =

    5.9974

 

My thanks to John d'Errico and Roger Stafford for numerous discussions about proofs and algorithms in this context.

 

John also wrote minboundrect from the FEX, which heavily influenced this submission.

 

Also in this archive i included a small plot function (plotminbox) to show the resulting box via connecting the cornerpoints.

文件下载列表
minboundbox.zip (5.66KB)  
附件内容(只显示3中的2个)
minboundbox.m  plotminbox.m  
标签: 最小包围盒 
更多

目前尚无评论

用户反馈   关于我们
Copyright (©) ZHIHUISHI.COM 2013 All Rights Reserved.
京ICP备14040384号