-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79b66e1
commit 48e083c
Showing
13 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.. _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** - Using make_histogram() | ||
|
||
There is an alternative way to create the histogram directly from | ||
a GIL image view. | ||
|
||
Syntax:: | ||
|
||
auto h = make_histogram(view(image)); | ||
|
||
where *image* could be a `gray8_image_t`/`rgb8_image_t` object read from source. | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.. _cumulative_histogram: | ||
|
||
Making a cumulative hsitogram | ||
============================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.. _extend_support: | ||
|
||
Extending | ||
========= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.. _fill_it: | ||
|
||
Fill histogram | ||
================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Histogram | ||
========= | ||
|
||
The GIL documentation sections listed below are dedicated to describe the | ||
histogram class and functions used in many image processing algorithms. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: Table of Contents | ||
|
||
overview | ||
create_a_histogram | ||
fill_it | ||
make_a_sub_histogram | ||
cumulative_histogram | ||
stl_compatibility | ||
entend_support | ||
limitations.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.. _limitations: | ||
|
||
Limitations | ||
=========== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.. _sub_histogram: | ||
|
||
Making a sub-histogram | ||
====================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Overview | ||
======== | ||
|
||
.. contents:: | ||
:local: | ||
:depth: 1 | ||
|
||
Description | ||
----------- | ||
|
||
The histogram class is built on top of std::unordered_map to keep it compatible with other | ||
STL algorithms. It can support any number of axes (known at compile time i.e. during class | ||
instantiation). Suitable conversion routines from GIL image constructs to the histogram bin | ||
key are shipped with the class itself. | ||
|
||
|
||
Tutorials | ||
--------- | ||
The following flow is recommended: | ||
#. :ref:`create_histogram` | ||
#. :ref:`fill_it` | ||
#. :ref:`sub_histogram` | ||
#. :ref:`cumulative_histogram` | ||
#. :ref:`stl_compat` | ||
#. :ref:`extend_support` | ||
#. :ref:`limitations` | ||
|
||
.. note:: To try out these tutorials you need to get a clone of the repository, since it is not yet released. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.. _stl_compat: | ||
|
||
STL compatibility | ||
================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Histogram | ||
========= | ||
|
||
The GIL documentation sections listed below are dedicated to describe the | ||
usage of external containers as histograms for GIL images. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: Table of Contents | ||
|
||
overview | ||
std |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Overview | ||
======== | ||
|
||
.. contents:: | ||
:local: | ||
:depth: 1 | ||
|
||
Description | ||
----------- | ||
Apart from the default class supplied by Boost.GIL, there are also provisions to | ||
use external containers like from std::vector, std::map, boost::histogram etc. These | ||
are provided as extensions. | ||
|
||
|
||
Extensions | ||
---------- | ||
Currently the following are available: | ||
#. std::vector (1D histogram support) | ||
#. std::map (1D histogram support) | ||
#. std::array (1D histogram support) | ||
#. std::unordered_map (1D histogram support) | ||
#. boost::histogram | ||
|
||
|
||
Adding an external container | ||
---------------------------- | ||
The workflow should be: | ||
#. Provide overloads for fill_histogram(must), make_histogram(optional) etc. in a new file preferably named after the container type in extensions/histogram/. | ||
#. Add tests to test/extensions/histogram. | ||
#. Add docs to docs/histogram/extensions. | ||
#. Other cmake,Jamfile,config etc. file changes. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.. _std: | ||
|
||
STD extension | ||
============= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters