Structuring element neighbor locations and heights


[offsets, heights] = getneighbors(SE)


[offsets, heights] = getneighbors(SE) returns the relative locations and corresponding heights for each of the neighbors in the structuring element object SE.

offsets is a P-by-N array where P is the number of neighbors in the structuring element and N is the dimensionality of the structuring element. Each row of offsets contains the location of the corresponding neighbor, relative to the center of the structuring element.

heights is a P-element column vector containing the height of each structuring element neighbor.

Class Support

SE is a STREL object. The return values offsets and heights are arrays of double-precision values.


se = strel([1 0 1],[5 0 -5])
[offsets,heights] = getneighbors(se)
se =
Nonflat STREL object containing 2 neighbors.

     1     0     1

     5     0    -5

offsets =
     0    -1
     0     1
heights =
     5    -5
Was this topic helpful?