VPI - Vision Programming Interface

3.2 Release

Temporal Noise Reduction

Performs temporal noise reduction in a sequence of images. More...

Data Structures

struct  VPITNRParams
 Structure that defines the parameters for vpiSubmitTemporalNoiseReduction. More...
 

Enumerations

enum  VPITNRPreset
 Defines scene presets for temporal noise reduction. More...
 
enum  VPITNRVersion
 Defines the version of the Temporal Noise Reduction algorithm to be used. More...
 

Functions

VPIStatus vpiCreateTemporalNoiseReduction (uint64_t backends, int32_t width, int32_t height, VPIImageFormat imgFormat, VPITNRVersion version, VPIPayload *payload)
 Creates a payload for Temporal Noise Reduction algorithm. More...
 
VPIStatus vpiInitTemporalNoiseReductionParams (VPITNRParams *params)
 Initializes vpiSubmitTemporalNoiseReduction with default values. More...
 
VPIStatus vpiSubmitTemporalNoiseReduction (VPIStream stream, uint64_t backend, VPIPayload payload, VPIImage prevFrame, VPIImage curFrame, VPIImage outFrame, const VPITNRParams *params)
 Submits a Temporal Noise Reduction operation to the stream. More...
 

Detailed Description

Performs temporal noise reduction in a sequence of images.

Refer to Temporal Noise Reduction for more details and usage examples.


Data Structure Documentation

◆ VPITNRParams

struct VPITNRParams

Structure that defines the parameters for vpiSubmitTemporalNoiseReduction.

Definition at line 166 of file TemporalNoiseReduction.h.

+ Collaboration diagram for VPITNRParams:
Data Fields
VPITNRPreset preset Scene preset to be used.
float strength Noise reduction strength.
  • Must be >= 0 and <=1.

Enumeration Type Documentation

◆ VPITNRPreset

#include <vpi/algo/TemporalNoiseReduction.h>

Defines scene presets for temporal noise reduction.

These presets are used by Temporal Noise Reduction to define its internal parameters suitable for noise reduction of scenes captured with given characteristics.

Enumerator
VPI_TNR_PRESET_DEFAULT 

Default preset, suitable for most scenes.

VPI_TNR_PRESET_OUTDOOR_LOW_LIGHT 

Low light outdoor scene.

VPI_TNR_PRESET_OUTDOOR_MEDIUM_LIGHT 

Medium light outdoor scene.

VPI_TNR_PRESET_OUTDOOR_HIGH_LIGHT 

Bright light outdoor scene.

VPI_TNR_PRESET_INDOOR_LOW_LIGHT 

Low light indoor scene.

VPI_TNR_PRESET_INDOOR_MEDIUM_LIGHT 

Medium light indoor scene.

VPI_TNR_PRESET_INDOOR_HIGH_LIGHT 

Bright light indoor scene.

Definition at line 83 of file TemporalNoiseReduction.h.

◆ VPITNRVersion

#include <vpi/algo/TemporalNoiseReduction.h>

Defines the version of the Temporal Noise Reduction algorithm to be used.

Higher version numbers usually achieve better quality.

Enumerator
VPI_TNR_DEFAULT 

Chooses the version with best quality available in the current device and given backend.

VPI_TNR_V1 

Version 1, without scene control and somewhat poor noise reduction capability specially in dark scenes, but runs fast.

  • Not supported anymore
VPI_TNR_V2 

Version 2, offers noise reduction strength control with decent processing speed.

  • Not supported anymore
VPI_TNR_V3 

Version 3, offers quite good quality overall, specially in dark scenes.

  • CUDA VIC and backends only supports this one.

Definition at line 97 of file TemporalNoiseReduction.h.

Function Documentation

◆ vpiCreateTemporalNoiseReduction()

VPIStatus vpiCreateTemporalNoiseReduction ( uint64_t  backends,
int32_t  width,
int32_t  height,
VPIImageFormat  imgFormat,
VPITNRVersion  version,
VPIPayload payload 
)

#include <vpi/algo/TemporalNoiseReduction.h>

Creates a payload for Temporal Noise Reduction algorithm.

This function allocates all resources needed by the algorithm and ties the returned payload to the given backend.

Parameters
[in]backendsVPI backends that are eligible to execute the algorithm.
[in]width,heightDimensions of frames to be processed.
  • Must be positive.
[in]imgFormatFormat of the images to be processed.
[in]versionVersion of the algorithm to be used.
[out]payloadPointer to the payload variable that receives the created handle.
Return values
VPI_IMAGE_FORMAT_INVALIDimgFormat is not supported.
VPI_ERROR_INVALID_ARGUMENTpayload is NULL.
VPI_ERROR_INVALID_ARGUMENTwidth or height outside valid range.
VPI_ERROR_INVALID_ARGUMENTInvalid TNR version.
VPI_ERROR_INVALID_ARGUMENTbackends refers to an invalid backend.
VPI_ERROR_INVALID_OPERATIONNo VIC support is available.
VPI_ERROR_INVALID_OPERATIONBackend isn't enabled in current context.
VPI_ERROR_NOT_IMPLEMENTEDTemporal Noise Reduction algorithm version is not supported by given backend.
VPI_ERROR_NOT_IMPLEMENTEDVIC Hardware with TNRv3 support is not available.
VPI_ERROR_INVALID_CONTEXTCurrent context is destroyed.
VPI_ERROR_OUT_OF_MEMORYCannot allocate required resources.
VPI_SUCCESSOperation executed successfully.

◆ vpiInitTemporalNoiseReductionParams()

VPIStatus vpiInitTemporalNoiseReductionParams ( VPITNRParams params)

#include <vpi/algo/TemporalNoiseReduction.h>

Initializes vpiSubmitTemporalNoiseReduction with default values.

Defaults:

Parameters
[in]paramsStructure to be filled with default values.
Return values
VPI_ERROR_INVALID_ARGUMENTparams is NULL.
VPI_SUCCESSOperation executed successfully.

◆ vpiSubmitTemporalNoiseReduction()

VPIStatus vpiSubmitTemporalNoiseReduction ( VPIStream  stream,
uint64_t  backend,
VPIPayload  payload,
VPIImage  prevFrame,
VPIImage  curFrame,
VPIImage  outFrame,
const VPITNRParams params 
)

#include <vpi/algo/TemporalNoiseReduction.h>

Submits a Temporal Noise Reduction operation to the stream.

Parameters
[in]streamThe stream where the operation will be queued in.
  • Must not be NULL.
  • Stream must have enabled the backends that will execute the algorithm.
[in]backendBackend that will execute the algorithm.
  • Must be the backend specified during payload creation or 0 as a shorthand to use this backend.
[in]payloadPayload to be submitted along the other parameters.
[in]prevFrameResult of the previous iteration. If the frame passed isn't the result image of the previous iteration, TNR will consider it to be NULL, i.e, the internal state will be reset and curFrame will be considered to be the first frame of a new sequence to be denoised.
  • When processing the first frame of a video sequence, this must be NULL.
  • Must have same format and dimensions as the one specified during payload creation.
  • Input must have enabled the backends that will execute the algorithm.
[in]curFrameCurrent (noisy) frame to be processed.
  • Must not be NULL.
  • Must have same format and dimensions as the one specified during payload creation.
  • Input must have enabled the backends that will execute the algorithm.
[out]outFrameOutput frame, where de-noised image will be written to.
  • Must not be NULL.
  • Must have same format and dimensions as the one specified during payload creation.
  • Input must have enabled the backends that will execute the algorithm.
[in]paramsControl parameters for temporal noise reduction If NULL, it'll use the defaults given by vpiInitTemporalNoiseReductionParams.
Return values
VPI_ERROR_INVALID_ARGUMENTstream is NULL.
VPI_ERROR_INVALID_ARGUMENTcurFrame or outFrame are NULL.
VPI_ERROR_INVALID_ARGUMENTpayload is not generated using vpiCreateTemporalNoiseReduction family of functions.
VPI_ERROR_INVALID_ARGUMENTprevFrame, curFrame and outFrame must have the same format and size configured during payload creation.
VPI_ERROR_INVALID_ARGUMENTStrength in params outside valid range.
VPI_ERROR_INVALID_PAYLOAD_TYPEpayload is invalid.
VPI_ERROR_INVALID_OPERATIONThe needed backends aren't enabled in stream, prevFrame, curFrame or outFrame.
VPI_SUCCESSOperation executed successfully.