boost::gil::histogram

Default histogram class provided by boost::gil.

Synopsis

Declared in <boost/gil/histogram.hpp>

template<typename... T>
class histogram
    : public std::unordered_map<std::tuple<T...>, double, detail::hash_tuple<T...>>

Description

The class inherits over the std::unordered_map provided by STL. A complete example/tutorial of how to use the class resides in the docs. Simple calling syntax for a 3D dimensional histogram :

histogram<int, int , int> h;
h(1, 1, 1) = 0;

This is just a starter to what all can be achieved with it, refer to the docs for the full demo.

Base Classes

Name

Description

std::unordered_map<std::tuple<T...>, double, detail::hash_tuple<T...>>

A standard container composed of unique keys (containing at most one of each key value) that associates values of another type with the keys.

Member Functions

Name

Description

histogram [constructor]

Default constructor

operator()

Returns bin value corresponding to specified tuple

equals

Checks if 2 histograms are equal. Ignores type, and checks if the keys (after type casting) match.

is_tuple_compatible

Checks if the histogram class is compatible to be used with the specified tuple type

key_from_tuple

Returns a key compatible to be used as the histogram key from the input tuple

key_from_pixel

Returns a histogram compatible key from the input pixel which can be directly used

nearest_key

Return nearest smaller key to specified histogram key

fill

Fills the histogram with the input image view

sub_histogram

sub_histogram overloads

normalize

Normalize this histogram class

sum

Return the sum count of all bins

min_key

Return the minimum key in histogram

max_key

Return the maximum key in histogram

sorted_keys

Return sorted keys in a vector

operator=

Assignment operators

get_allocator

Returns the allocator object used by the %unordered_map.

empty

Returns true if the %unordered_map is empty.

size

Returns the size of the %unordered_map.

max_size

Returns the maximum size of the %unordered_map.

begin

begin overloads

cbegin

end

end overloads

cend

emplace

Attempts to build and insert a std::pair into the %unordered_map.

emplace_hint

Attempts to build and insert a std::pair into the %unordered_map.

extract

Extract a node.

insert

insert overloads

try_emplace

Attempts to build and insert a std::pair into the %unordered_map.

insert_range

Inserts a range of elements.

insert_or_assign

Attempts to insert a std::pair into the %unordered_map.

erase

erase overloads

clear

Erases all elements in an %unordered_map. Note that this function only erases the elements, and that if the elements themselves are pointers, the pointed‐to memory is not touched in any way. Managing the pointer is the user's responsibility.

swap

Swaps data with another %unordered_map.

merge

hash_function

Returns the hash functor object with which the %unordered_map was constructed.

key_eq

Returns the key comparison object with which the %unordered_map was constructed.

find

Tries to locate an element in an %unordered_map.

count

Finds the number of elements.

contains

Finds whether an element with the given key exists.

equal_range

Finds a subsequence matching given key.

operator[]

Subscript ( [] ) access to %unordered_map data.

at

Access to %unordered_map data.

bucket_count

Returns the number of buckets of the %unordered_map.

max_bucket_count

Returns the maximum number of buckets of the %unordered_map.

bucket_size

bucket

load_factor

Returns the average number of elements per bucket.

max_load_factor

max_load_factor overloads

rehash

May rehash the %unordered_map.

reserve

Prepare the %unordered_map for a specified number of elements.

Static Member Functions

Name

Description

dimension

Returns the number of dimensions(axes) the class supports.

is_pixel_compatible

Checks if the histogram class is compatible to be used with a GIL image type

Non-Member Functions

Name

Description

histogram_equalization

Overload for histogram equalization algorithm, takes in a single source histogram and returns the color map used for histogram equalization.

histogram_equalization

Overload for histogram equalization algorithm, takes in both source histogram & destination histogram and returns the color map used for histogram equalization as well as transforming the destination histogram.

histogram_matching

Overload for histogram matching algorithm, takes in source histogram, reference histogram & destination histogram and returns the color map used for histogram matching as well as transforming the destination histogram.

histogram_matching

Overload for histogram matching algorithm, takes in a single source histogram & reference histogram and returns the color map used for histogram matching.

Created with MrDocs