Main Content

reflect

Reflect structuring element

Description

SE2 = reflect(SE) reflects the structuring element (or structuring elements) specified by SE. This method reflects the structuring element through its center. The effect is the same as if you rotated the structuring element's domain 180 degrees around its center (for a 2-D structuring element).

example

Examples

collapse all

Create a structuring element.

se = strel([0 0 1; 0 0 0; 0 0 0])
se = 
strel is a arbitrary shaped structuring element with properties:

      Neighborhood: [3x3 logical]
    Dimensionality: 2

Look at the neighborhood.

se.Neighborhood
ans = 3x3 logical array

   0   0   1
   0   0   0
   0   0   0

Reflect it.

se2 = reflect(se)
se2 = 
strel is a arbitrary shaped structuring element with properties:

      Neighborhood: [3x3 logical]
    Dimensionality: 2

Look at the reflected neighborhood.

se2.Neighborhood
ans = 3x3 logical array

   0   0   0
   0   0   0
   1   0   0

Create an offsetstrel structuring element.

se = offsetstrel("ball",5,6.5)
se = 
offsetstrel is a ball shaped offset structuring element with properties:

            Offset: [11x11 double]
    Dimensionality: 2

Reflect the structuring element.

se2 = reflect(se)
se2 = 
offsetstrel is a ball shaped offset structuring element with properties:

            Offset: [11x11 double]
    Dimensionality: 2

Input Arguments

collapse all

Structuring element, specified as a strel or offsetstrel object or array of objects. If SE is an array of structuring element objects, then reflect reflects each element of SE.

Output Arguments

collapse all

Reflected structuring element, returned as a strel or offsetstrel object or array of objects. SE2 has the same size as SE.

Version History

Introduced before R2006a