隔离3D数据点的策略 [英] Strategy for isolating 3d data points

查看:87
本文介绍了隔离3D数据点的策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两点,一组来自分析,另一组将用于对分析数据进行后处理的结果.

I have two sets of points, one from an analysis and another that I will use for the results of post-processing on the analysis data.

分析数据以黑色分散.

The analysis data, in black, is scattered.

用于结果的点为红色.

The points used for results are red.

这是同一幅图上的两个集合:

Here are the two sets on the same plot:

我的问题是:我将对红点进行插值,但是正如您所看到的,有一些红点落在黑色数据集的空白区域内.插值会导致在这些点处存在非零值,但是在最终数据集中这些值必须为零是很重要的.

The problem I have is this: I will be interpolating onto the red points, but as you can see there are red points which fall inside areas of the black data set that are in voids. Interpolation causes there to be non-zero values at those points but it is essential that these values be zero in the final data set.

我一直在考虑将这些值归零的几种策略.以下是几个不分先后的顺序:

I have been thinking of several strategies for getting those values to zero. Here are several in no particular order:

  1. 找到一个凸包,其顶点仅包含黑色数据点,并且在凸集内仅包含红色数据点.另外,应该在满足两个条件的同时最大化该船体的面积.

事实证明,这很难实施,主要是因为必须从迭代搜索凸包的过程中选择应该排除哪些黑色数据点.

This has proven to be fairly difficult to implement, mostly due to having to select which black data points should be excluded from the iterative search for a convex hull.

  1. 使用单个值(例如1或0)向数据集添加额外的维度,因此两者都可以属于同一数据集,但仍可区分.使用kNN(最近邻居)算法仅选择空隙中的红色点.基本思想是,空隙中的红点将具有自己集合中最接近的n(6?)个最接近的邻居.由无效边界分隔的红色数据点将仅具有不同的数量,最后,从边界移除至少一个步骤的红色点将具有几乎所有黑色数据集的邻居.我已经看到的用于该方法的现有算法返回索引或数组掩码,这两者都是很好的解决方案.我尚未尝试实现此功能.

  1. Add an extra dimension to the data sets with a single value, like 1 or 0, so both can be part of the same data set yet still distinguishable. Use a kNN (nearest neighbor) algorithm to choose only red points in the voids. The basic idea is that red points in voids will have nearest n(6?) nearest neighbors which are in their own set. Red data points that are separated by a void boundary only will have a different amount, and lastly, the red points at least one step removed from a boundary will have a almost all black data set neighbors. The existing algorithms I have seen for this approach return indices or array masks, both of which will be a good solution. I have not yet tried implementing this yet.

从用于创建黑色数据集的SolidWorks模型中手动提取边界点.在这么多层次上都不行这必须手动完成,z层到z层,而我所显示的图片仅代表实际全套的一小部分.

Manually extract boundary points from the SolidWorks model that was used to create the black data set. No on so many levels. This would have to be done manually, z-level by z-level, and the pictures I have shown only represent a small portion of the actual, full set.

通过对红色数据点的子集进行多次细化来手动创建蒙版,我视觉上确认这是感兴趣的.还有,没有除非我没有其他选择,否则不会.

Manually create masks by making several refinements to a subset of red data points that I visually confirm to be of interest. Also, no. Not unless I have run out of options.

如果这是一个明确的解决方案问题,那么我看不到它.我希望提议的解决方案2成为解决方案2,因为实际上看起来这是实施和实际操作中最有趣的.无论哪种方式,如标题所述,我仍在寻找解决该问题的策略的方向.我唯一能确定的是Python是正确的工具.

If this is a problem with a clear solution, then I am not seeing it. I'm hoping that proposed solution 2 will be the one, because that actually looks like it would be the most fun to implement and see in action. Either way, like the title says, I'm still looking for direction on strategies to solve this problem. About the only thing I'm sure of is that Python is the right tool.

分析数据包含x,y,z和3个电场分量值,Ex,Ey和Ez.黑色数据集中的空隙位于金属内部,因此电位没有变化,换句话说,电场值都完全为零.

The analysis data contains x, y, z, and 3 electric field component values, Ex, Ey, and Ez. The voids in the black data set are inside of metal and hence have no change in electric potential, or put another way, the electric field values are all exactly zero.

此图显示了使用Ex分量与scipy的griddata进行线性插值的单个z层.黑色椭圆形是该中央跑道形空隙的空隙边界的 rough 指示.您可以看到椭圆形内部有红色和蓝色(x方向上的+和-E字段).它应该为零(此图中为绿色).完成的数据将用于跟踪带电粒子束,因此,如果其中一个粒子的路径实际越过空隙,则进行跟踪的软件只能知道电势是否保持恒定,即知道路径穿过固体金属,并丢弃了该路径.

This image shows a single z-layer using linear interpolation of the Ex component with scipy's griddata. The black oval is a rough indicator of the void boundary for that central racetrack shaped void. You can see that there is red and blue (for + and - E field in the x direction) inside the oval. It should be zero (lt. green in this plot). The finished data is going to be used to track a beam of charged particles and so if a path of one of the particles actually crossed into the void the software that does the tracking can only tell if the electric potential remains constant, i.e. it knows that the path goes through solid metal and it discards that path.

如果空隙中存在电场,则粒子跟踪软件将不知道其中存在某些结构,并且会发生坏事.

If electric field exists in the void the particle tracking software doesn't know that some structure is there and bad things happen.

推荐答案

您也许可以使用称为支持向量机"的大数据技术来解决此问题.如您所述分配0和1分类,然后通过libsvm算法运行它.您应该能够使用此模型对要归零的点进行分类和识别,并以编程方式进行归类.

You might be able to solve this with the big-data technique called "Support Vector Machine". Assign the 0 and 1 classifications as you mentioned, and then run this through the libsvm algorithm. You should be able to use this model to classify and identify the points you need to zero out, and do so programmatically.

我意识到SVM和libsvm实现有一个学习曲线.如果超出您的工作量预算,我深表歉意.

I realize that there is a learning curve for SVM and the libsvm implementation. If this is outside your effort budget, my apologies.

这篇关于隔离3D数据点的策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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