필터 지우기
필터 지우기

Identify connected points in a grid

조회 수: 2 (최근 30일)
Arseny Kubryakov
Arseny Kubryakov 2015년 8월 12일
댓글: Arseny Kubryakov 2015년 8월 12일
Dear all! I have a grid with 0 and 1. My task is to cluster connected points with 1. For example
00001100
01100001
01110101
01000001
Here there are 4 different clusters. I have create a simple code with cycle, that works fine. But it slows dramatically when I began to use it with large arrays (like 1000x1000) May be it is a simple task, but I still can not find optimal solution. Please, give me an advice.
  댓글 수: 2
Purushottama Rao
Purushottama Rao 2015년 8월 12일
what is the ouput expected?
Arseny Kubryakov
Arseny Kubryakov 2015년 8월 12일
The expected output is the consistent number of cluster at every grid point, i.e. for given example this will be
00001100
02200003
02220403
02000003

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2015년 8월 12일
bwlabel() or regionprops()

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by