The image statistics algorithm performs a two dimensional (2D) operation on the input image with the provided mask image of same dimensions. The mask defines the pixels considered for the operation. The algorithm calculates the per-channel statistics namely pixel count, sum, mean, variance, covariance of the input image masked by the mask image. Both variance and covariance are stored in a single 4x4 covariance matrix, where the diagonal is the variance and the non-diagonal elements are the covariance per-channel, considering 4 maximum number of channels.
Input | Parameters | Output |
---|---|---|
Mask is passed as NULL (All pixels considered). Flag is VPI_STAT_COVARIANCE |
\[ PixelCount = 393216 \] \[ Per-Channel Sum: \begin{bmatrix} 50316744 & 47610060 & 45611460 & 0 \\ \end{bmatrix} \] \[ Per-Channel Mean: \begin{bmatrix} 127.962097 & 121.078644 & 115.995941 & 0 \\ \end{bmatrix} \] \[ Covariance Matrix: \begin{bmatrix} 4062.606201 & 4022.210693 & 3351.239990 & 0 \\ 4022.210693 & 4263.414551 & 3651.921387 & 0\\ 3351.239990 & 3351.239990 & 3293.198730 & 0\\ 0 & 0 & 0 & 0 \end{bmatrix} \] |
The image stats works calculating various per-channel statistics of the input image defined by the mask image. The various statistics that can be calculated have their own flags. The output is stored in an array of type VPI_ARRAY_TYPE_STATISTICS. The user can choose which statistics should be calculated.
*valid - Here valid means the input image pixels that have corresponding non-zero mask pixels.
For list of limitations, constraints and backends that implements the algorithm, consult reference documentation of the following functions:
Function | Description |
---|---|
vpiSubmitImageStats | Returns various image statistics of the input image. |
For more information, see Image Statistics in the "API Reference" section of VPI - Vision Programming Interface.
For information on how to use the performance table below, see Algorithm Performance Tables.
Before comparing measurements, consult Comparing Algorithm Elapsed Times.
For further information on how performance was benchmarked, see Performance Benchmark.