RPP filter augmentations#

RppStatus rppt_box_filter(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32u kernelSize, RpptImageBorderType borderType, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#

Box Filter augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.

The box filter augmentation runs for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).

  • dstPtr depth ranges - Will be same depth as srcPtr.

    Sample Input

    Sample Input#

    Sample 3x3 Output

    Sample 3x3 Output#

    Sample 5x5 Output

    Sample 5x5 Output#

    Sample 7x7 Output

    Sample 7x7 Output#

    Sample 9x9 Output

    Sample 9x9 Output#

Parameters:
  • srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)

  • dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)

  • kernelSize – [in] kernel size for box filter (a single Rpp32u number with kernelSize > 0 that applies to all images in the batch. kernelSize = 3/5/7/9 are optimized to run faster)

  • borderType – [in] border type for padding during filtering (Restrictions - RpptImageBorderType::REPLICATE only mode supported)

  • roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))

  • roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)

  • rppHandle – [in] RPP HIP/HOST handle created with rppCreate()

  • executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)

Return values:
  • RPP_SUCCESS – Successful completion.

  • RPP_ERROR* – Unsuccessful completion.

Returns:

A RppStatus enumeration.

RppStatus rppt_median_filter(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32u kernelSize, RpptImageBorderType borderType, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#

Median Filter augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.

The median filter replaces each pixel’s value with the median of its surrounding pixels in a square window of size kernel size x kernel size. The Median filter augmentation runs for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).

  • dstPtr depth ranges - Will be same depth as srcPtr.

    Sample Input

    Sample Input#

    Sample 3x3 Output

    Sample 3x3 Output#

    Sample 5x5 Output

    Sample 5x5 Output#

    Sample 7x7 Output

    Sample 7x7 Output#

    Sample 9x9 Output

    Sample 9x9 Output#

Parameters:
  • srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)

  • dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)

  • kernelSize – [in] kernel size for median filter (a single Rpp32u number with kernelSize > 0 that applies to all images in the batch. kernelSize = 3/5/7/9 are optimized to run faster)

  • borderType – [in] Border type for padding in the median filter (currently, only RpptImageBorderType::REPLICATE is supported)

  • roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))

  • roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)

  • rppHandle – [in] RPP HIP/HOST handle created with rppCreate()

  • executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)

Return values:
  • RPP_SUCCESS – Successful completion.

  • RPP_ERROR* – Unsuccessful completion.

Returns:

A RppStatus enumeration.

RppStatus rppt_gaussian_filter(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f *stdDevTensor, Rpp32u kernelSize, RpptImageBorderType borderType, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#

Gaussian Filter augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.

The Gaussian filter augmentation runs for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).

  • dstPtr depth ranges - Will be same depth as srcPtr.

    Sample Input

    Sample Input#

    Sample 3x3 Output

    Sample 3x3 Output#

    Sample 5x5 Output

    Sample 5x5 Output#

    Sample 7x7 Output

    Sample 7x7 Output#

    Sample 9x9 Output

    Sample 9x9 Output#

Parameters:
  • srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)

  • dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)

  • stdDevTensor – [in] stdDev values for gaussian calculation (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize, for each image in batch)

  • kernelSize – [in] kernel size for gaussian filter (a single Rpp32u number with kernelSize > 0 that applies to all images in the batch. kernelSize = 3/5/7/9 are optimized to run faster)

  • borderType – [in] border type for padding during filtering (Restrictions - RpptImageBorderType::REPLICATE only mode supported)

  • roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))

  • roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)

  • rppHandle – [in] RPP HIP/HOST handle created with rppCreate()

  • executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)

Return values:
  • RPP_SUCCESS – Successful completion.

  • RPP_ERROR* – Unsuccessful completion.

Returns:

A RppStatus enumeration.

RppStatus rppt_sobel_filter(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32u sobelType, Rpp32u kernelSize, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#

Sobel Filter augmentation on HIP/HOST backend for a NHWC/NCHW layout tensor.

The sobel filter augmentation runs for a batch of RGB(3 channel) / greyscale(1 channel) images with NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).

  • dstPtr depth ranges - Will be same depth as srcPtr.

    Sample Input

    Sample Input#

    Sample 3x3 Output

    Sample 3x3 Output#

    Sample 5x5 Output

    Sample 5x5 Output#

    Sample 7x7 Output

    Sample 7x7 Output#

    Sample 3x3 Output

    Sample 3x3 Output#

    Sample 5x5 Output

    Sample 5x5 Output#

    Sample 7x7 Output

    Sample 7x7 Output#

    Sample 3x3 Output

    Sample 3x3 Output#

    Sample 5x5 Output

    Sample 5x5 Output#

    Sample 7x7 Output

    Sample 7x7 Output#

Parameters:
  • srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)

  • dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW, c = 1)

  • sobelType – [in] sobel type for sobel filter (a single Rpp32u number with sobelType = 0 (X Gradient) / 1 (Y Gradient) / 2 (XY Gradient) that applies to all images in the batch)

  • kernelSize – [in] kernel size for sobel filter (a single Rpp32u odd number with kernelSize = 3/5/7 that applies to all images in the batch)

  • roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))

  • roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)

  • rppHandle – [in] RPP HIP/HOST handle created with rppCreate()

  • executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)

Return values:
  • RPP_SUCCESS – Successful completion.

  • RPP_ERROR* – Unsuccessful completion.

Returns:

A RppStatus enumeration.

RppStatus rppt_emboss(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f *strength, Rpp32u kernelSize, RpptImageBorderType borderType, RpptROIPtr roiTensorPtrSrc, RpptRoiType roiType, rppHandle_t rppHandle, RppBackend executionBackend)#

Emboss augmentation on HIP/HOST backend for a NCHW/NHWC layout tensor.

The emboss augmentation runs for a batch of RGB(3 channel) / greyscale(1 channel) images with an NHWC/NCHW tensor layout.

  • srcPtr depth ranges - Rpp8u (0 to 255), Rpp16f (0 to 1), Rpp32f (0 to 1), Rpp8s (-128 to 127).

  • dstPtr depth ranges - Will be same depth as srcPtr.

    Sample Input

    Sample Input#

    Sample 3x3 Output

    Sample 3x3 Output#

    Sample 5x5 Output

    Sample 5x5 Output#

    Sample 7x7 Output

    Sample 7x7 Output#

    Sample 9x9 Output

    Sample 9x9 Output#

Parameters:
  • srcPtr – [in] source tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • srcDescPtr – [in] source tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = 1/3)

  • dstPtr – [out] destination tensor in HIP memory (for HIP backend) or HOST memory (for HOST backend)

  • dstDescPtr – [in] destination tensor descriptor (Restrictions - numDims = 4, offsetInBytes >= 0, dataType = U8/F16/F32/I8, layout = NCHW/NHWC, c = same as that of srcDescPtr)

  • strength – [in] strength values for emboss calculation (1D tensor in pinned / HIP memory (for HIP backend) or HOST memory (for HOST backend), of size batchSize, for each image in batch)

  • kernelSize – [in] kernel size for emboss (a single Rpp32u odd number with kernelSize = 3/5/7/9 that applies to all images in the batch)

  • borderType – [in] border type for padding during filtering (Restrictions - RpptImageBorderType::REPLICATE only mode supported)

  • roiTensorPtrSrc – [in] ROI data in HIP memory (for HIP backend) or HOST memory (for HOST backend), for each image in source tensor (2D tensor of size batchSize * 4, in either format - XYWH(xy.x, xy.y, roiWidth, roiHeight) or LTRB(lt.x, lt.y, rb.x, rb.y))

  • roiType – [in] ROI type used (RpptRoiType::XYWH or RpptRoiType::LTRB)

  • rppHandle – [in] RPP HIP/HOST handle created with rppCreate()

  • executionBackend – [in] backend for execution (RppBackend::RPP_HOST_BACKEND or RppBackend::RPP_HIP_BACKEND)

Return values:
  • RPP_SUCCESS – Successful completion.

  • RPP_ERROR* – Unsuccessful completion.

Returns:

A RppStatus enumeration.