Name

CloseImage — applies a morphological closing filter to an image

Calling Sequence

ResultImage = CloseImage(Image, StructureElement)

Parameters

Image

2D matrix of type uint8, uint16, uint32, double or boolean

StructureElement

struct with the components Width, Height and Data, should be generated using CreateStructureElement

ResultImage

matrix of the same size and type as Image

Description

This function applies a morphological closing filter to an image. This filter retains light objects and removes dark objects the structuring element does not fit in.

Examples

Image = 0.5 * ones(9, 9) // generate gray image

Image(:, 3) = 0 // draw dark line

Image(:, 7) = 1 // draw light line

StructureElement = CreateStructureElement('square', 3) // generate structuring element

ResultImage = CloseImage(Image, StructureElement)