Functions
VXLIB_meanStdDev_i8u_o32f

Functions

VXLIB_STATUS VXLIB_meanStdDev_i8u_o32f (const uint8_t src[restrict], const VXLIB_bufParams2D_t *src_addr, VXLIB_F32 *fmean, VXLIB_F32 *fstddev, uint32_t *pixelsProcessed, VXLIB_F32 *fcurrentSum, VXLIB_F32 *fcurrentSqSum)
 
VXLIB_STATUS VXLIB_meanStdDev_i8u_o32f_checkParams (const uint8_t src[], const VXLIB_bufParams2D_t *src_addr)
 

Detailed Description

Function Documentation

◆ VXLIB_meanStdDev_i8u_o32f()

VXLIB_STATUS VXLIB_meanStdDev_i8u_o32f ( const uint8_t  src[restrict],
const VXLIB_bufParams2D_t *  src_addr,
VXLIB_F32 *  fmean,
VXLIB_F32 *  fstddev,
uint32_t *  pixelsProcessed,
VXLIB_F32 *  fcurrentSum,
VXLIB_F32 *  fcurrentSqSum 
)
Description:
Computes the mean pixel value and the standard deviation of the pixels in the input image (which has a dimension width and height).
Method:
The mean and standard deviations are computed using the following equations:
 fmean = (sum(src(x,y)) / (width * height)

 fstddev = sqrt( (sum(src(x,y)^2) - fmean^2) / (width * height) )
Parameters
[in]src[]Pointer to array containing input image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src
[out]fmeanParameter corresponding to the mean of the image
[out]fstddevParameter corresponding to the standard deviation of the image
[in,out]pixelsProcessedParameter corresponding to the number of pixels already processed
[in,out]fcurrentSumParameter corresponding to the sum of pixels already processed
[in,out]fcurrentSqSumParameter corresponding to the square of the sum of pixels already processed
Assumptions:
  • I/O buffer pointers are assumed to be not aliased.
  • PARAMETER INITIALIZATION:
    • pixelsProcessed, fcurrentSum, and fcurrentSqSum are exposed on the API to aid in block-based processing.
    • They shall be initialized to zero before processing each image.
    • If a user wants to divide processing of the image into smaller blocks, these parameters should only be set to zero before processing the first block, and should not be modified in-between blocks, as they maintain the state of the intermediate results within the image processing.
Performance Considerations:
  • For best performance, the following parameter settings are recommended:
    • Set width equal to stride
    • Set all stride values to a multiple of 16
    • Set all width values to a multiple of 16

◆ VXLIB_meanStdDev_i8u_o32f_checkParams()

VXLIB_STATUS VXLIB_meanStdDev_i8u_o32f_checkParams ( const uint8_t  src[],
const VXLIB_bufParams2D_t *  src_addr 
)
Description:
Checks the parameters for programming errors for the VXLIB_meanStdDev_i8u_o32f function.
Method:
The following checks are made:
  • There shall be no NULL pointers
  • All images shall have the same x and y dimensions
  • The strides of each image shall be equal to or greater than the x dimension
Parameters
[in]src[]Pointer to array containing first input image (UQ8.0)
[in]src_addr[]Pointer to structure containing dimensional information of src

Copyright 2022, Texas Instruments Incorporated