spice::statistics namespace

This namespace exports a number of functions for calculating statistics on images.

Contents

Functions

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

Function documentation

template<typename T, size_t Channels>
std::vector<std::vector<size_t>> spice::statistics::histogram(image<T, Channels> 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.