SE = strel(nhood)
SE = strel('arbitrary', nhood)
SE = strel(shape, size)
SE = strel('disk', radius, n)
SE = strel('diamond', radius)
SE = strel('octagon', radius)
SE = strel('line', len, deg)
SE = strel('cube', n)
SE = strel('cuboid', [m n p])
SE = strel('sphere', radius)
| Parameter | Description |
|---|---|
| nhood | Logical neighborhood for an arbitrary structuring element. |
| shape | Shape name: 'arbitrary', 'square', 'rectangle', 'line', 'disk', 'diamond', 'octagon', 'cube', 'cuboid', or 'sphere'. |
| size | Positive scalar or size vector used by square, rectangle, cube, or cuboid shapes. |
| radius | Nonnegative integer radius used by disk, diamond, octagon, and sphere shapes. |
| len | Positive integer length used by the line shape. |
| deg | Line angle in degrees. |
| n | Optional disk decomposition count, accepted as 0, 4, 6, or 8. |
| Parameter | Description |
|---|---|
| SE | Structuring element structure with type and nhood fields. |
Create a flat structuring element. Supported 2-D shapes include arbitrary, square, rectangle, line, disk, diamond and octagon. Supported 3-D shapes include arbitrary, cube, cuboid and sphere. The optional disk decomposition count n can be 0, 4, 6 or 8; Nelson currently returns the exact disk neighborhood. The octagon radius must be a nonnegative multiple of 3.
SE=strel('disk',8);
figure; imagesc(SE.nhood); g=linspace(0,1,64)'; colormap([g g g]); title('Structuring element');
D = strel('diamond', 1);
A = strel([0 1 0; 1 1 1; 0 1 0])
SE = strel('sphere', 1);
sum(SE.nhood(:))
| Version | Description |
|---|---|
| 2.0.0 | initial version |