Documentation Center

  • Trial Software
  • Product Updates

getneighbors

Structuring element neighbor locations and heights

Syntax

[offsets, heights] = getneighbors(SE)

Description

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

Examples

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

Neighborhood:
     1     0     1

Height:
     5     0    -5

offsets =
     0    -1
     0     1
heights =
     5    -5

See Also

| |

Was this topic helpful?