Steve on Image Processing

June 13th, 2007

Connected component labeling – Wrapping up

I've about run out of things to say for now about connected component labeling algorithms. ("Hurray!" shouts the audience.)

For reference, here's a summary of all the posts in the series:

2 Responses to “Connected component labeling – Wrapping up”

  1. Ram replied on :

    hi steve,

    Is there a way of establishing custom connectivity
    such as conn=[00100;
    01110;
    11111;
    01110;
    00100];?
    If i am not wrong bwlabel allows only scalars 4 and 8.

  2. Steve replied on :

    Ram—Use bwlabeln, which allows custom connectivity matrix. However, your example is not a valid connectivity matrix. The Image Processing Toolbox connectivity definitions do not allow you to say that a pixel is directly adjacent to another pixel that’s two steps away, which is what your matrix implies.


MathWorks
Steve Eddins is a software development manager in the MATLAB and image processing areas at MathWorks. Steve coauthored Digital Image Processing Using MATLAB. He writes here about image processing concepts, algorithm implementations, and MATLAB.

These postings are the author's and don't necessarily represent the opinions of The MathWorks.