how bwlabel determine each unique label for each object in image ?

2 views (last 30 days)
i have image
how bwlabel determine each unique label for labeling each object in this image ? how bwlabel select objects to be labeled 1 or 2 or 3 etc ? whether the unique label choose with random ?? thanks

Accepted Answer

Image Analyst
Image Analyst on 18 Apr 2016
Starting at the upper left pixel, it goes down rows until it hits a new, unlabeled object. Then it labels all the pixels in it. Then it continues going down rows, and moving over columns until it has found all of the blobs. So the numbers are going from top to bottom and left to right, NOT left to right and top to bottom like you'd read a book.
  3 Comments
ElizabethR
ElizabethR on 19 Apr 2016
Edited: ElizabethR on 19 Apr 2016
yes you are right, I had experienced problems like that.So it make me confused how to bwlabel labeled each object in image. But, thank you so much for your explanation. Now I have understoodv how bwlabel work. Once again thank you so much. God Bless :)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by