Re: How does bwlabel work?



Ross asked about the order in which bwlabel searches for connected components, and whether it's possible to change that order.

Yumnam wrote:

> BWlabel basically finds the connected components of a
> binary image. All the pixels in a connected components are
> given a level. The searching of the connected components is
> done in the coulmn-wise fashion, in other words, in
> top-to-bottom scan order. All pixels in the first conected
> component is labeled 1 and those in the second as 2 and so on.

Right. Some ordering changes can happen when two or more sets of pixels are initially assigned different labels, but later the algorithm discovers they actually belong to the same object.

There's no way to tell bwlabel to search in a different order. If it did search in a different order, it would run significantly slower because of memory cache effects.

Wolfgang Schwanghart wrote:
See:
http://blogs.mathworks.com/steve/category/connected-components/

Thanks for the plug, Wolfgang.

Since this question has come up multiple times, I've added "show how to post-process output of bwlabel to sort object labels as desired" to my list of potential blog topics. Watch for it, maybe soon.

---
Steve Eddins
http://blogs.mathworks.com/steve/
.



Relevant Pages

  • Re: Remove speckles in bilevel (bw) image
    ... pixels of B_0. ... be 'bounding box size'. ... pixel rectangle is modified by filling with black ...
    (sci.image.processing)
  • Re: Image detection
    ... pixels and length of 500 pixels. ... the problem of discarding the non-textual components of the image ... may be solved by deleting the connected components that are too large ... Illumination problems can also affect results. ...
    (comp.soft-sys.matlab)
  • Re: How does bwlabel work?
    ... binary image. ... All the pixels in a connected components are ... The searching of the connected components is ...
    (comp.soft-sys.matlab)