Motion Blur Filter

Filter

RIF_IMAGE_FILTER_MOTION_BLUR

Description

Motion blur is achieved by blurring in only 1 direction.

Parameters

Parameter

Type

Input/Output

Description

radius

uint

input

The radius of the region that is used for blurring.
Value range is [0, 50], default value is 5.

direction

float2

input

The motion direction.
Default value is (1, 1).

Usage Example

rif_image_filter filter = nullptr;
rifContextCreateImageFilter(context, RIF_IMAGE_FILTER_MOTION_BLUR, &filter);
rifImageFilterSetParameter1u(filter_, "radius", 7);
rifImageFilterSetParameter2f(filter_, "direction", 1.0f, 1.0f);
rifCommandQueueAttachImageFilter(queue, filter, inputImage, outputImage);
rifContextExecuteCommandQueue(context, queue, nullptr, nullptr, nullptr);

Results

Input image

Output image (dir = (1,1))