为什么 binary_opening() 会删除图像的像素,我该如何避免这种情况?

问题描述 投票:0回答:0

几周前我发布了以下问题:Get number of pixels in clusters with same color in an image

此解决方案与我在上一个问题中发布的图像一起使用。现在我有一个类似的图像,但我有一个问题:

binary_opening()
删除集群的像素。比如,有几个 3x3 像素簇,
binary_opening()
删除角像素。我得到的不是像素数 = 9,而是像素数 = 5。我怎样才能避免这种情况?

我想在图像的每个簇中拥有正确数量的像素。我希望有人能提供帮助。

python image count k-means scikit-image
© www.soinside.com 2019 - 2024. All rights reserved.