找到许多明亮圆圈的质心
我正在使用 Python 找到下图中每个亮点的质心,以计算邻居之间的平均距离。 scipy.ndimage.find_objects 和 scipy.ndimage.center_of_mass 似乎很有希望,但我不知道如何将所有内容放在一起。 我在哪里可以找到一些参考资料? 我已经使用 Tracker “手动”完成了该任务,但我想自动化该过程。 谢谢。
I'm using Python to find the centroid of each bright point in the following image, to calculate the average distance between neighbours.
scipy.ndimage.find_objects and scipy.ndimage.center_of_mass seem promising, but I don't see how to put everything together.
Where can I find some references?
I've done the task "manually" with Tracker, but I'd like to automate the process.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们可能可以使用 scipy.ndimage.find_objects 来解决它,但我更喜欢使用 cv2.connectedComponentsWithStats:
scipy.spatial.distance
中的cdist
开始计算。这是一个代码示例:
测试图像:

average_distance_ Between_neighbors = 21.858534029025055
We can probably solve it using
scipy.ndimage.find_objects
, but I prefer using cv2.connectedComponentsWithStats:cdist
fromscipy.spatial.distance
.Here is a code sample:
Test image:

average_distance_between_neighbors = 21.858534029025055