Functions
VXLIB_histogramCdfLut_i32u_o8u

Functions

VXLIB_STATUS VXLIB_histogramCdfLut_i32u_o8u (const uint32_t src[restrict], uint32_t cdf[restrict], uint8_t dst[restrict], uint32_t numPixels, uint32_t minValue)
 
VXLIB_STATUS VXLIB_histogramCdfLut_i32u_o8u_checkParams (const uint32_t src[restrict], const uint32_t cdf[restrict], const uint8_t dst[restrict], uint32_t numPixels, uint32_t minValue)
 

Detailed Description

Function Documentation

◆ VXLIB_histogramCdfLut_i32u_o8u()

VXLIB_STATUS VXLIB_histogramCdfLut_i32u_o8u ( const uint32_t  src[restrict],
uint32_t  cdf[restrict],
uint8_t  dst[restrict],
uint32_t  numPixels,
uint32_t  minValue 
)
Description:
Used as part of histogram equalization, it takes, as input, the histogram of an image, generates the CDF (cumulative distribution function) of the histogram, and then generates a lookup table that can be used against the input image to generate an output image with an equalized histogram.

The VXLIB_equalizeHist_i8u_o8u function can do all of this in one shot, however, if the image processing is to be broken up into blocks (for DMA for example), then the user needs access to this function separate from the image access functions. The order of operation would be to use:

  1. VXLIB_histogramSimple_i8u_o32u (for every block in the image)
  2. VXLIB_histogramCdfLut_i32u_o8u (once on the final output histogram of VXLIB_histogramSimple_i8u_o32u)
  3. VXLIB_tableLookup_i8u_o8u (for every block in the image)
Parameters
[in]src[]Pointer to histogram of an image containing 256 bins (UQ32.0)
[out]cdf[]Pointer to cumulative distribution output containing 256 bins (optional) (UQ32.0)
[out]dst[]Pointer to lookup table output containing 256 entries (optional) (UQ8.0)
[in]numPixelsNumber of pixels in the image that the src[] histogram comes from (UQ32.0)
[in]minValueMinimum value in the image that the src[] histogram comes from (UQ32.0)
Assumptions:
  • I/O buffer pointers are assumed to be not aliased.
  • All buffer pointers are 8 byte aligned
  • All buffer pointers point to arrays of 256 entries each
Performance Considerations:
  • For best performance, the following parameter settings are recommended:
    • Both cdf and dst buffers are optional. Put a NULL pointer for the output which is not needed.

◆ VXLIB_histogramCdfLut_i32u_o8u_checkParams()

VXLIB_STATUS VXLIB_histogramCdfLut_i32u_o8u_checkParams ( const uint32_t  src[restrict],
const uint32_t  cdf[restrict],
const uint8_t  dst[restrict],
uint32_t  numPixels,
uint32_t  minValue 
)
Description:
Checks the parameters for programming errors for the VXLIB_histogramCdfLut_i32u_o8u function.
Method:
The following checks are made:
  • src pointer shall not be NULL
Parameters
[in]src[]Pointer to histogram of an image containing 256 bins (UQ32.0)
[out]cdf[]Pointer to cumulative distribution output containing 256 bins (optional) (UQ32.0)
[out]dst[]Pointer to lookup table output containing 256 entries (optional) (UQ8.0)
[in]numPixelsNumber of pixels in the image that the src[] histogram comes from (UQ32.0)
[in]minValueMinimum value in the image that the src[] histogram comes from (UQ32.0)

Copyright 2022, Texas Instruments Incorporated