Name

CreateStructureElement — generates a structuring element for morphological filters

Calling Sequence

StructureElement = CreateStructureElement(Name, Parameter);

Parameters

Name

a string, can be 'circle', 'square', 'rectangle', 'vertical_line' , 'horizontal_line' or 'custom'. Name is not case sensitive.

Parameter

specifies the size of the structuring element if Name is not 'custom'. If Name is 'rectangle', Parameter must be a vector containing the width in the first and the height in the second component. For all other values of Name, Parameter must be a scalar. If name is 'circle', Parameter is the radius of the circle.

If Name is 'custom', Parameter must be a boolean 2D matrix.

StructureElement

struct with the components

  • Width: number of columns of structuring element

  • Height: number of rows of structuring element

  • Data: boolean matrix

Description

This function generates a structuring element described by a struct containing a boolean matrix and the number of columns and rows of this matrix.

Examples

StructureElement = CreateStructureElement('square', 3)

See also

DilateImage, ErodeImage, CloseImage, OpenImage, TopHat, BottomHat, MorphologicalFilter