VPI - Vision Programming Interface

1.2 Release

Image histogram

Computes image histogram from the input image. More...

Functions

VPIStatus vpiCreateHistogramEven (uint32_t backends, VPIImageFormat fmt, float start, float end, int32_t numBins, VPIPayload *payload)
 Creates payload for Image Histogram Even algorithm. More...
 
VPIStatus vpiSubmitHistogram (VPIStream stream, uint32_t backend, VPIPayload payload, VPIImage input, VPIArray output, uint32_t flags)
 Computes the image histogram. More...
 

Detailed Description

Computes image histogram from the input image.

Function Documentation

◆ vpiCreateHistogramEven()

VPIStatus vpiCreateHistogramEven ( uint32_t  backends,
VPIImageFormat  fmt,
float  start,
float  end,
int32_t  numBins,
VPIPayload payload 
)

#include <vpi/algo/Histogram.h>

Creates payload for Image Histogram Even algorithm.

It calculates the image histogram assuming uniform (even) bins.

Parameters
[in]backendsVPI backends that are eligible to execute the algorithm. Currently only one backend is accepted.
[in]fmtFormat of input image
[in]startSpecifies the low end of the histogram range (inclusive).
[in]endSpecifies the high end of the histogram range (exclusive).
[in]numBinsSpecifies the number of bins in the output array.
[out]payloadPointer to memory where the created payload handle will be written to.
Returns
an error code on failure else VPI_SUCCESS.

◆ vpiSubmitHistogram()

VPIStatus vpiSubmitHistogram ( VPIStream  stream,
uint32_t  backend,
VPIPayload  payload,
VPIImage  input,
VPIArray  output,
uint32_t  flags 
)

#include <vpi/algo/Histogram.h>

Computes the image histogram.

Parameters
[in]streamThe stream where the operation will be queued in.
[in]backendBackend that will execute the algorithm. Must be one of the backends specified during payload creation. If 0, VPI will select one of the eligible backends from the payload that accepts the given parameters, usually the fastest one.
[in]payloadpayload created with vpiCreateHistogramEven
[in]inputInput image. Supported formats are: VPI_IMAGE_FORMAT_U8, VPI_IMAGE_FORMAT_U16.
[out]outputWhere the resulting image histogram will be written to. It must have been created with the desired number of bins.
[in]flagsIf this flags is set to VPI_ACCUMULATE_OUTPUT, the output will be not be cleared first. Otherwise set this flag to 0 by default to clear out the value in the output array.
Returns
an error code on failure else VPI_SUCCESS.