Clear Filters
Clear Filters

I can't understand what is bwconncomp command do ?

6 views (last 30 days)
What does "connecting components" mean ? What are components ? What they connect ?

Answers (2)

Image Analyst
Image Analyst on 6 May 2017
If all you have is one giant image, essentially a collection of individual pixel elements, and you want the area of one blob in the image, then how do you think you can do it? How do you think it would know that pixel 5 is connected to pixel 6 (assuming they're both true/white/1 in the binary image) but pixel 498357 (far away and separated by big swaths of black from pixel 5) is not part of the same blob and should not be counted in the area computation? You have to give each connected set of pixels in a blob an ID number, so it will know pixels 5 and 6 are part of blob #1 but pixel #498357 is part of blob #135 (or whatever).
Read this page https://en.wikipedia.org/wiki/Connected-component_labeling and see if you still don't know what it is after reading that.

Steven Lord
Steven Lord on 6 May 2017
This example in the documentation describes and illustrates what a connected component is.
Why might you be interested in connected components? Take a look at the "before" and "after" pictures in the "Erase Largest Component from Image" example on the documentation page for bwconncomp. Note that the "different" in the before picture has become "di erent" in the after picture, because the two f's were connected to one another and so were considered one component. But in other words in the picture, the individual letters will be the components.
  1 Comment
Alex Dashevsky
Alex Dashevsky on 6 May 2017
Edited: Alex Dashevsky on 6 May 2017
I still don't understand this command. I need example with more details.

Sign in to comment.

Categories

Find more on Read, Write, and Modify Image in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!