avatar
how to find a cluster# CS - 计算机科学
e*f
1
I have a question and hope someone smart here can help me out.
I have a binary 2-dimensional image, say 16 by 16 pixels. The pixel values
are either 0 or 1 and are randomly distributed. We define a cluster as: for
those non-zero pixels, if they share at least one side with each other, they
form a cluster of connectivity-1. What is the simple algorithm to search
for these clusters and find the largest one (larget number of pixels in one
cluster)?
Your help is highly appreciated!
avatar
e*f
2
?
avatar
t*a
3
Your problem is officially called "connected component labeling", just
google
it. the easiest algorithm is called the two-pass union-find algorithm.

for
they
one

【在 e****f 的大作中提到】
: I have a question and hope someone smart here can help me out.
: I have a binary 2-dimensional image, say 16 by 16 pixels. The pixel values
: are either 0 or 1 and are randomly distributed. We define a cluster as: for
: those non-zero pixels, if they share at least one side with each other, they
: form a cluster of connectivity-1. What is the simple algorithm to search
: for these clusters and find the largest one (larget number of pixels in one
: cluster)?
: Your help is highly appreciated!

avatar
e*f
4
thanks, already found it.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。