[英]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.