You are here : matlabImage Processingconndef

conndef() - Image Processing

conn = conndef(num_dims,type) 
returns the connectivity array defined by type for num_dims dimensions.
Several Image Processing Toolbox™ functions use conndef to
create the default connectivity input argument. Code Generation support:
Yes.MATLAB Function Block support:
Yes.


Syntax

conn = conndef(num_dims,type) example


Example

Create 2-D Connectivity Array with Minimal ConnectivityOpen This Example
Create a 2-D connectivity array.conn = conndef(2,'minimal')

conn =

     0     1     0
     1     1     1
     0     1     0

Create 2-D Connectivity Array with Maximal ConnectivityOpen This Example
Create a 2-D connectivity array.conn = conndef(2,'maximal')

conn =

     1     1     1
     1     1     1
     1     1     1

Create 3-D Connectivity Array with Minimal ConnectivityOpen This Example
Create a 3-D connectivity array.conndef(3,'minimal')

ans(:,:,1) =

     0     0     0
     0     1     0
     0     0     0


ans(:,:,2) =

     0     1     0
     1     1     1
     0     1     0


ans(:,:,3) =

     0     0     0
     0     1     0
     0     0     0


Output / Return Value


Limitations


Alternatives / See Also


Reference