2
0
mirror of https://github.com/boostorg/gil.git synced 2026-01-22 17:22:26 +00:00
Files
gil/doc/histogram/create.rst
Debabrata Mandal dc9ba74cb3 Add docs for histogram (#503)
* Add docs for histogram

* Add docs and make changes:

 - Made changes suggested in first review

 - Add docs for relevant files

* Rename docs file and correct typos

* Change doc for cumulative histogram

* Add docs for histogram equalization

* Make changes suggested in review

* Add docs

* Remove docs for algorithms

* Move images to test_images

Co-authored-by: Mateusz Łoskot <mateusz@loskot.net>
2021-03-24 21:19:06 +01:00

43 lines
919 B
ReStructuredText

.. _create_histogram:
Create a histogram
==================
**Method 1** - Using the histogram constructor
Syntax::
histogram<Type1, Type2, Type3,... TypeN>
``Type1`` .. ``TypeN`` correspond to the axis type of the N axes in the histogram
Example: If we want a 3D histogram of Axis1 of type ``int``, Axis2 of type ``float`` and Axis3 of type ``std::string``
we would do it this way::
histogram<int, float, std::string> h;
And done.
**Method 2** (TODO) - Using make_histogram()
There is an alternative to create the histogram directly from
a GIL image view.
This should be the preferred over method-1 when creating
histogram with GIL images, since it creates a histogram with axes configured
to match the GIL image.
Also it is easier than method-1.
Syntax::
auto h = make_histogram(view(image));
where ``image`` could be a ``gray8_image_t``/``rgb8_image_t`` object read from source.