Functions
VXLIB_median_MxN_i8u_i8u_o8u

Functions

VXLIB_STATUS VXLIB_median_MxN_i8u_i8u_o8u (const uint8_t src[restrict], const VXLIB_bufParams2D_t *src_addr, uint8_t dst[restrict], const VXLIB_bufParams2D_t *dst_addr, const uint8_t mask[restrict], const VXLIB_bufParams2D_t *mask_addr, int64_t scratch[restrict], uint32_t scratchSize)
 
VXLIB_STATUS VXLIB_median_MxN_i8u_i8u_o8u_checkParams (const uint8_t src[restrict], const VXLIB_bufParams2D_t *src_addr, const uint8_t dst[restrict], const VXLIB_bufParams2D_t *dst_addr, const uint8_t mask[restrict], const VXLIB_bufParams2D_t *mask_addr, const int64_t scratch[restrict], uint32_t scratchSize)
 

Detailed Description

Function Documentation

◆ VXLIB_median_MxN_i8u_i8u_o8u()

VXLIB_STATUS VXLIB_median_MxN_i8u_i8u_o8u ( const uint8_t  src[restrict],
const VXLIB_bufParams2D_t *  src_addr,
uint8_t  dst[restrict],
const VXLIB_bufParams2D_t *  dst_addr,
const uint8_t  mask[restrict],
const VXLIB_bufParams2D_t *  mask_addr,
int64_t  scratch[restrict],
uint32_t  scratchSize 
)
Description:
Implements MxN Erosion, with programmable structuring element mask.
Method:
The output pixels is the min value of the pixels in the TRUE mask regions of the MxN neighborhood of the input pixel.
Parameters
[in]src[]Pointer to array containing input image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[out]dst[]Pointer to array containing output image (UQ8.0)
[in]dst_addr[]Pointer to structure containing dimensional information of dst
[in]mask[]Pointer to array containing mask image (UQ8.0)
[in]mask_addr[]Pointer to structure containing dimensional information of mask
[in]scratch[]Pointer to buffer containing scratch memory (SQ63.0)
[in]scratchSizeSize of scratch buffer in bytes (UQ32.0)
Assumptions:
  • I/O buffer pointers are assumed to be not aliased.
  • Output height should be == (Input height - (Mask height - 1))
  • Output width should be == (Input width - (Mask width - 1)) OR (Input width)
  • Mask values are either 255 (TRUE), or 0 (FALSE)
  • Mask stride should be equal to the mask width
  • Minimum dimension of the mask is 1 for both width and height
  • Maximum dimension of the mask is 9 for both width and height
  • Scratch buffer should be at least the number of true values in mask * 2 * 8 bytes
  • Scratch buffer should be 8 byte aligned
Performance Considerations:
  • For best performance, the following parameter settings are recommended:
    • Set output width values to a multiple of 16
    • Set widths equal to each other and equal to strides (allows processing over whole image in single loop)

◆ VXLIB_median_MxN_i8u_i8u_o8u_checkParams()

VXLIB_STATUS VXLIB_median_MxN_i8u_i8u_o8u_checkParams ( const uint8_t  src[restrict],
const VXLIB_bufParams2D_t *  src_addr,
const uint8_t  dst[restrict],
const VXLIB_bufParams2D_t *  dst_addr,
const uint8_t  mask[restrict],
const VXLIB_bufParams2D_t *  mask_addr,
const int64_t  scratch[restrict],
uint32_t  scratchSize 
)
Description:
Checks the parameters for programming errors for the VXLIB_median_MxN_i8u_i8u_o8u function.
Method:
The following checks are made:
  • There shall be no NULL pointers
  • Output height should be == (Input height - (Mask height - 1))
  • Output width should be <= Input width
  • The strides of each image shall be equal to or greater than the x dimension
  • The min value for mask width and height should be 1
  • The max value for mask width and height should be 9
  • The mask width should be equal to the stride
  • Scratch buffer should be at least the number of true values in mask * 2 * 8 bytes
  • Scratch buffer should be 8 byte aligned
Parameters
[in]src[]Pointer to array containing input image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[out]dst[]Pointer to array containing output image (UQ8.0)
[in]dst_addr[]Pointer to structure containing dimensional information of dst
[in]mask[]Pointer to array containing mask image (UQ8.0)
[in]mask_addr[]Pointer to structure containing dimensional information of mask
[in]scratch[]Pointer to buffer containing scratch memory (SQ63.0)
[in]scratchSizeSize of scratch buffer in bytes (UQ32.0)

Copyright 2023, Texas Instruments Incorporated