bwlabel()- clarification and manipulation

3 Ansichten (letzte 30 Tage)
matar maoz
matar maoz am 3 Mär. 2011
I didnt understand the terms 4- connected objects and 8- connected bjects put in the econd argument of the function
Another question is- How does matlab determine the numbering of the objects? Can I use matlab to start numbering from the middle of the matrix? It doesn't matter to me if I need to use another function
Matar Maoz

Akzeptierte Antwort

David Young
David Young am 3 Mär. 2011
The ordering is arbitrary in bwlabel - and if you think about images with complex, arbitrary-shaped regions, it's clear that it would be very difficult to offer anything else in a general function.
You can use regionprops to find region centres, compute the distances od these from the image centre, then use sort to put the regions in order, and relabel.

Weitere Antworten (1)

Sean de Wolski
Sean de Wolski am 3 Mär. 2011
1) 4-connected means the (2d) pixels must be sharing a side 8-connected means the (2d) pixels can be sharing a side or a corner
2) As far as labeling order, I don't know if there is a stock way to do that.

Kategorien

Mehr zu Lighting, Transparency, and Shading finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by