Local Weighted Regression Filter

Filter

RIF_IMAGE_FILTER_LWR_DENOISE

Description

This denoiser filter can be used when a large number of auxiliary data is known. The filter builds a linear regression model for color (out = A*in + B*depth + C*normal + D*position + E*transmission + F) dependence. The filter solves the least-squares regression for colors linear approximation in the small (local) window to obtain coefficients and reconstruct colors. To eliminate blurring of boundaries, bandwidth estimation and bias (F) used.

Parameters

Parameter

Type

Input/Output

Description

vColorImg

image

input

The image containing input color temporal variance (see Temporal Accumulation Filter). Temporal variance is used to adjust the bandwidth.

transImg

image

input

Transition color image. Corresponds to the colors of the objects (textures) without the shading effects or the color of primary rays when ray-tracing is used for rendering. Used to construct a linear regression model of the output color. The parameter is optional. If used, can improve regression model and filtering result.

vTransImg

image

input

The image containing transition colors temporal variance (see Temporal Accumulation Filter). Temporal variance is used to adjust the bandwidth.

normalsImg

image

input

The image containing normal vectors. Used to construct a linear regression model of the output color. The parameter is optional. If used, can improve regression model and filtering result.

vNormalsImg

image

input

The image containing normal vector temporal variance (see Temporal Accumulation Filter). Temporal variance is used to adjust the bandwidth.

depthImg

image

input

The image containing depth value. Used to construct a linear regression model of the output color. The parameter is optional. If used, can improve regression model and reduce the output noise.

vDepthImg

image

input

The image containing depth temporal variance (see Temporal Accumulation Filter). Temporal variance is used to adjust the bandwidth.

samples

uint

input

The number of samples per pixel used for image rendering.
Default value is 4.

halfWindow

uint

input

Size of the region for which a regression model is solved.
Value range is [1, 10], default value is 5.

bandwidth

float

input

Bandwidth of the filter. A smaller value provides less noise in the output image, but may result in loss of image details.
Default value is 1.

Usage Example

rif_image_filter filter = nullptr;
rifContextCreateImageFilter(context, RIF_IMAGE_FILTER_LWR_DENOISE, &filter);
rifImageFilterSetParameterImage(filter, "vColorImg", vColorImage);
rifImageFilterSetParameterImage(filter, "transImg", transitionImage);
rifImageFilterSetParameterImage(filter, "vTransImg", vTransitionImage);
rifImageFilterSetParameterImage(filter, "normalsImg", normalsImage);
rifImageFilterSetParameterImage(filter, "vNormalsImg", vNormalsImage);
rifImageFilterSetParameterImage(filter, "depthImg", depthImage);
rifImageFilterSetParameterImage(filter, "vDepthImg", vDepthImage);
rifImageFilterSetParameter1f(filter, "bandwidth", 1);
rifImageFilterSetParameter1u(filter, "halfWindow", 5);
rifImageFilterSetParameter1u(filter, "samples", 16);
rifCommandQueueAttachImageFilter(queue, filter, inputImage, outputImage);
rifContextExecuteCommandQueue(context, queue, nullptr, nullptr, nullptr);