decompose

Return sequence of decomposed structuring elements

Syntax

``SEQ = decompose(SE)``

Description

example

````SEQ = decompose(SE)` returns an array of structuring elements, `SEQ`, that are the decomposition of the structuring element `SE`. `SEQ` is equivalent to `SE`, but the elements of `SEQ` cannot be decomposed further.```

Examples

collapse all

Create a disk-shaped structuring element.

`se = strel('square',5)`
```se = strel is a square shaped structuring element with properties: Neighborhood: [5x5 logical] Dimensionality: 2 ```

Extract the decomposition of the structuring element.

`seq = decompose(se)`
```seq = 2x1 strel array with properties: Neighborhood Dimensionality ```

To see that dilating sequentially with the decomposed structuring elements really does form a 5-by-5 square, use `imdilate` with the full option.

`imdilate(1,seq,'full')`
```ans = 5×5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ```

Create a ball-shaped structuring element.

`se = offsetstrel('ball',5, 6.5)`
```se = offsetstrel is a ball shaped offset structuring element with properties: Offset: [11x11 double] Dimensionality: 2 ```

Obtain the decomposition of the structuring element.

`seq = decompose(se)`
```seq = 1x8 offsetstrel array with properties: Offset Dimensionality ```

Input Arguments

collapse all

Structuring element, specified as a `strel` or `offsetstrel` object.

Output Arguments

collapse all

Sequence of structuring elements that approximate the desired shape, returned as an array of `strel` or `offsetstrel` objects.

Version History

Introduced before R2006a