Main Content

getneighbors

Structuring element neighbor locations and heights

getneighbors will be removed in a future release. See strel for the current list of functions recommended for use with structuring elements.

Description

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

example

Examples

collapse all

Create a nonflat 2-D structuring element with two neighbors.

se = strel("arbitrary",[1 0 1],[5 0 -5]);

Get the row and column offset of each neighbor from the center of the structuring element. Also get the heights of the neighbors.

[offsets,heights] = getneighbors(se)
offsets =

     0    -1
     0     1


heights =

     5    -5

Input Arguments

collapse all

Structuring element, specified as a strel object with P neighbors and dimensionality N.

Output Arguments

collapse all

Position of neighbors relative to the center of the structuring element, in pixels, returned as a P-by-N matrix.

Data Types: double

Height of neighbors, returned as a P-by-1 column vector.

Data Types: double

Version History

Introduced before R2006a

See Also