Filter löschen
Filter löschen

Identify connected points in a grid

2 Ansichten (letzte 30 Tage)
Arseny Kubryakov
Arseny Kubryakov am 12 Aug. 2015
Kommentiert: Arseny Kubryakov am 12 Aug. 2015
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 Kommentare
Purushottama Rao
Purushottama Rao am 12 Aug. 2015
what is the ouput expected?
Arseny Kubryakov
Arseny Kubryakov am 12 Aug. 2015
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

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 12 Aug. 2015
bwlabel() or regionprops()

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by