what is the algorithm of bwconncomp?

Anyone know the algorithm of bwconncomp? and how do they work to generate a pixel index list output from a binary image?

Answers (1)

Algorithms
The basic steps in finding the connected components are:
  1. Search for the next unlabeled pixel, p.
  2. Use a flood-fill algorithm to label all the pixels in the connected component containing p.
  3. Repeat steps 1 and 2 until all the pixels are labeled.

2 Comments

Searching starts at the top left pixel and goes down rows in the left-most (first) column, then moves to the next column to the right going down rows looking for unlabeled pixels, and continues until all columns have been checked.
The documentation no longer has an Algorithms section; the last version this was documented is https://www.mathworks.com/help/releases/R2021b/images/ref/bwconncomp.html#bu2xdbl-6

Sign in to comment.

Asked:

on 28 Nov 2019

Commented:

on 13 Mar 2023

Community Treasure Hunt

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

Start Hunting!