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=

Assignment operators

at

Access to %unordered_map data.

begin

begin overloads

bucket

bucket_count

Returns the number of buckets of the %unordered_map.

bucket_size

cbegin

cend

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.

count

Finds the number of elements.

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.

empty

Returns true if the %unordered_map is empty.

end

end overloads

equal_range

Finds a subsequence matching given key.

equals

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

erase

erase overloads

extract

Extract a node.

fill

Fills the histogram with the input image view

find

Tries to locate an element in an %unordered_map.

get_allocator

Returns the allocator object used by the %unordered_map.

hash_function

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

insert

insert overloads

insert_or_assign

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

is_tuple_compatible

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

key_eq

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

key_from_pixel

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

key_from_tuple

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

load_factor

Returns the average number of elements per bucket.

max_bucket_count

Returns the maximum number of buckets of the %unordered_map.

max_key

Return the maximum key in histogram

max_load_factor

max_load_factor overloads

max_size

Returns the maximum size of the %unordered_map.

merge

min_key

Return the minimum key in histogram

nearest_key

Return nearest smaller key to specified histogram key

normalize

Normalize this histogram class

operator()

Returns bin value corresponding to specified tuple

operator[]

Subscript ( [] ) access to %unordered_map data.

rehash

May rehash the %unordered_map.

reserve

Prepare the %unordered_map for a specified number of elements.

size

Returns the size of the %unordered_map.

sorted_keys

Return sorted keys in a vector

sub_histogram

sub_histogram overloads

sum

Return the sum count of all bins

swap

Swaps data with another %unordered_map.

try_emplace

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

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