spice::statistics namespace

Contents

This namespace exports a number of functions providing statistics on images.

Functions

template<typename T>
auto histogram(image<T> const& source, size_t samples) -> std::vector<std::vector<size_t>>

Function documentation

template<typename T>
std::vector<std::vector<size_t>> spice::statistics::histogram(image<T> const& source, size_t samples)

Parameters
source The image to analyse
samples The granularity with which to divide the intensity range of the image.
Returns A vector of vectors of length samples where each of the sub-vectors represents the histogram of one channel.

Calculates the source image's histogram. The resulting histogram will contain the absolute count of pixel values matching each class.