Dilate (Erode) Filter

Filter

RIF_IMAGE_FILTER_DILATE_ERODE

Description

This filter widens and enhances dark (bright) areas of the image.

For every image pixel, it brings the pixel value (luminosity) into line with the lowest (greatest) value of the 8 neighboring pixels (3x3 matrix). So, a dark (bright) pixel is added around dark (bright) areas. An isolated pixel on a brighter (darker) background will be changed to a big “pixel”, composed of 9 pixels, and that will create some noise in the image.

Parameters

Parameter

Type

Input/Output

Description

mode

uint

input

Operation mode. Supported modes:

  • RIF_DILATE (default)

  • RIF_ERODE

Usage Example

rif_image_filter filter = nullptr;
rifContextCreateImageFilter(context, RIF_IMAGE_FILTER_DILATE_ERODE, &filter);
rifImageFilterSetParameter1u(filter, "mode", RIF_DILATE);
rifCommandQueueAttachImageFilter(queue, filter, inputImage, outputImage);
rifContextExecuteCommandQueue(context, queue, nullptr, nullptr, nullptr);

Results

Dilate

Input image

Output image

Erode

Input image

Output image