![]() |
The open imaging DSP library
|
Compute statistics on images. More...
Functions | |
void | mpix_stats_from_buf (struct mpix_stats *stats, const uint8_t *buf, struct mpix_format *fmt) |
Collect red, green, blue channel averages of all pixels in an RGB24 frame. | |
uint8_t | mpix_stats_get_y_mean (struct mpix_stats *stats) |
Get the mean value from a histogram. | |
Compute statistics on images.
SPDX-License-Identifier: Apache-2.0
void mpix_stats_from_buf | ( | struct mpix_stats * | stats, |
const uint8_t * | buf, | ||
struct mpix_format * | fmt | ||
) |
Collect red, green, blue channel averages of all pixels in an RGB24 frame.
If the nvals
field of stats
is non-zero, then this value will be used to select the number of pixels sampled from the image. Otherwise a default will be provided.
stats | Struct collecting the image statistics. |
buf | Buffer of pixels in RGB24 format (3 bytes per pixel) to collect the statistics from. |
width | Width of the buffer in pixels. |
height | Height of the buffer in pixels. |
fourcc | Pixel format of the buffer. |
uint8_t mpix_stats_get_y_mean | ( | struct mpix_stats * | stats | ) |
Get the mean value from a histogram.
The result is the mean expressed as grayscale pixel value: range 0 to 255.
stats | Statistics collected from the image |