简体   繁体   English

从给定的 2D numpy 阵列中移除集群

[英]Removal of a cluster from a given 2D numpy array

I have a binary 2D np array containing information in the following (example) figure.我有一个二进制 2D np 数组,其中包含以下(示例)图中的信息。 How can I detect the cluster of data points (here black in color) so that I can remove the cluster of points from the array one by one?如何检测数据点簇(此处为黑色),以便我可以从数组中一一删除点簇? Here, think of it as controlling and accordingly removing the circles from the image as per the user's task need.在这里,将其视为根据用户的任务需要控制并相应地从图像中删除圆圈。

Task: Detection and removal of any one of the n-cluster of data points from a numpy array任务:从 numpy 阵列中检测和删除任何一个 n 簇数据点

Any leads would be appreciated.任何线索将不胜感激。 [Image for reference] [图片供参考]

在此处输入图像描述

opencv is indeed a good choice. opencv确实是个不错的选择。 However, instead of blob detection, I would suggest to find "connected components" which gives you some more flexibility.但是,我建议不要使用 blob 检测,而是找到“连接的组件”,这会给您带来更多的灵活性。 This answer should lead you into the right direction: connected component labeling in python这个答案应该引导您走向正确的方向: python 中的连接组件标签

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 2D numpy 数组中的簇大小? - Cluster sizes in 2D numpy array? 给定范围内的2D NumPy数组比较 - 2D NumPy array comparison in given range 从二维 numpy 数组中提取二维 numpy 数组 - Extracting a 2D numpy array from a 2D numpy array 从第二个2D阵列给出的索引周围的1D numpy数组中有效切片窗口 - Efficiently slice windows from a 1D numpy array, around indices given by second 2D array (Python Numpy)如何从给定的二维数组创建新的 3D 数组? - (Python Numpy) How can I create new 3D array from given 2D array? 从给定的索引中取出 numpy 一维数组的多个切片,将结果复制到二维数组中 - Taking multiple slices of numpy 1d array from given indices, copying result into 2d array 给定一个代表二维分布的二维 Numpy 数组,如何借助 Numpy 或 Scipy 函数从该分布中采样数据? - Given a 2D Numpy array representing a 2D distribution, how to sample data from this distribution with the aid of Numpy or Scipy functions? 给定具有排列的列表,重新排列给定 numpy 2D 数组的行 - Rearrange rows of a given numpy 2D array given a list with the permutations 如何在2D numpy数组中找到簇大小? - How to find cluster sizes in 2D numpy array? 在2D NumPy数组中聚类非零值 - Cluster non-zero values in a 2D NumPy array
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM