Class

MPSImageDilate

A filter that finds the maximum pixel value in a rectangular region centered around each pixel in the source image.

Declaration

@interface MPSImageDilate : MPSUnaryImageKernel

Overview

An MPSImageDilate filter behaves like the MPSImageAreaMax filter, except that the intensity at each position is calculated relative to a different value before determining which is the maximum pixel value, allowing for shaped, non-rectangular morphological probes.

Listing 1 shows pseudocode for the calculation used to return each pixel value.

Listing 1

MPSImageDilate Pseudocode

for each pixel in the filter window
    value = pixel[filterY][filterX] - filter[filterY*filter_width+filterX]
    if( value > bestValue ){
        result = value
        bestValue = value
    }

A filter that contains all zeros is identical to an MPSImageAreaMax filter. The center filter element is assumed to be 0 to avoid causing a general darkening of the image. The edgeMode property value is assumed to always be MPSImageEdgeModeClamp for this filter.

Topics

Methods

- initWithDevice:kernelWidth:kernelHeight:values:

Initializes the kernel with a specified width, height, and weight values.

Properties

kernelHeight

The height of the filter window. which must be an odd number.

kernelWidth

The width of the filter window which must be an odd number.

Relationships

Inherits From

See Also

Morphological Image Filters

MPSImageAreaMax

A filter that finds the maximum pixel value in a rectangular region centered around each pixel in the source image.

MPSImageAreaMin

A filter that finds the minimum pixel value in a rectangular region centered around each pixel in the source image.

MPSImageErode

A filter that finds the minimum pixel value in a rectangular region centered around each pixel in the source image.