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.
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.
About
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.
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.
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.