检测任意形状 [英] Detecting arbitrary shapes

查看:107
本文介绍了检测任意形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候,



我们有一组点代表3D体和水平面的交点。我们希望检测代表身体横截面的2D形状。可以有一个或多个这样的形状。我们找到了讨论如何使用Hough变换对图像进行操作的文章,但是我们可能有成千上万个这样的点,因此转换为图像是非常浪费的。有没有更简单的方法来做到这一点?



谢谢

解决方案

在将3D模型转换为一组点时,您已经丢弃了找到相交形状所需的信息。假设您已经或可以构建3D模型地形(假设您已经或可以构建3D模型地形)一些顶点,顶点之间的边,被边界约束的面):


  1. 遍历边列表,直到找到与测试相交的点平面,将其添加到列表中

  2. 选择共享此边的一个面

  3. 遍历该面的其他边以找到下一个面将其添加到列表中

  4. 为共享该边缘的其他人脸重复该动作,直到您返回到开始边缘为止

您已经创建了与平面相交的边的有序列表 - 对于每个边进行线性插值以找到交点,以形成交集形状的顺序很简单。请注意,这个过程假定脸部多边形是凸面的,这是你的情况。
如果你的体积是凹的,你将有多个离散的相交形状,所以你需要重复这个过程,直到所有的边都被检查过。


执行此操作的java代码 http://code.google.com/p/rugl/source/browse/#svn%2Ftrunk%2Ffun%2FUtil%2Fsrc%2Fcom%2Fryanm%2Futil%2Fgeom%2Fvolumerel =nofollow>这里,以及一个非常漂亮的测试应用程序这里



控制:


  • 1-5改变测试量

  • q和w可以改变查询平面的数量

  • a,s和d可以改变查询平面的扫描速度
  • 左键单击并拖动以旋转视图
  • 右键单击并拖动以旋转查询平面


Greetings,

We have a set of points which represent an intersection of a 3d body and a horizontal plane. We would like to detect the 2D shapes that represent the cross sections of the body. There can be one or more such shapes. We found articles that discuss how to operate on images using Hough Transform, but we may have thousands of such points, so converting to an image is very wasteful. Is there a simpler way to do this?

Thank you

解决方案

In converting your 3D model to a set of points, you have thrown away the information required to find the intersection shapes. Walk the edge-face connectivity graph of your 3D model to find the edge-plane intersection points in order.

Assuming you have, or can construct, the 3d model topography (some number of vertices, edges between vertices, faces bound by edges):

  1. Iterate through the edge list until you find one that intersects the test plane, add it to a list
  2. Pick one of the faces that share this edge
  3. Iterate through the other edges of that face to find the next intersection, add it to the list
  4. Repeat for the other face that shares that edge until you arrive back at the starting edge

You've built an ordered list of edges that intersect the plane - it's trivial to linearly interpolate each edge to find the intersection points, in order, that form the intersection shape. Note that this process assumes that the face polygons are convex, which in your case they are. If your volume is concave you'll have multiple discrete intersection shapes, and so you need to repeat this process until all edges have been examined.

There's some java code that does this here, and a rather nifty test application here.

Controls:

  • 1-5 to change the test volume
  • q and w to alter the number of query planes
  • a, s, and d to alter the scan speed of the query planes
  • left-click-drag to rotate the view
  • right-click-drag to rotate the query planes

这篇关于检测任意形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆