The Histogram class is a class for creating, managing, loading, and saving histogram for an Image.
More...
#include <histogram.hpp>
|
| Histogram () |
| Histogram is the basic constructor setting variables to defaults. More...
|
|
| Histogram (Image *imgIn, VALUE_SPACE type, int nBin, int channel=0) |
| Histogram is an extension of the basic constructor, where calculate is called in order to populate the Histogram. More...
|
|
| ~Histogram () |
| ~Histogram is the basic destructor which frees memory. More...
|
|
void | release () |
| release More...
|
|
void | calculate (Image *imgIn, VALUE_SPACE type=VS_LIN, int nBin=256, BBox *box=NULL, int channel=0) |
| calculate computes the histogram of an input image. In the case of LDR images, they are ssumed to be normalized; i.e. with values in [0, 1]. This function computes the histogram for a single color channel. More...
|
|
void | uniform (float fMin, float fMax, uint value, VALUE_SPACE type, int nBin) |
| uniform More...
|
|
void | update (float fMin, float fMax) |
| update More...
|
|
int | project (float x) |
| project converts an input value in the histogram domain. More...
|
|
float | unproject (int ind) |
| unproject converts a histogram value back to its original domain. More...
|
|
void | ceiling (float k) |
| ceiling limits the maximum value of the histogram using Ward algorithm. More...
|
|
void | clip (uint value) |
| clip clips the histogram to value. More...
|
|
float * | cumulativef (bool bNormalized) |
| cumulativef computes the cumulative Histogram. More...
|
|
float * | getCumulativef () |
| getCumulativef this function returns the cumulative Histogram. Note that cumulativef needs to be computed before otherwise the function will return a NULL pointer. More...
|
|
float | getfMin () |
| getfMin More...
|
|
float | getfMax () |
| getfMax More...
|
|
float * | getNormalized (bool bNor=true) |
| getNormalized normalizes the Histogram. More...
|
|
float | getOtsu () |
| getOtsu More...
|
|
void | write (std::string name, bool bNor) |
| write saves the Histogram as an Image into a file. More...
|
|
std::vector< float > | exposureCovering (int nBits=8, float overlap=1.0f) |
| exposureCovering computes the exposure values for fully covering the dynamic range of the image. This function works only if the histogram was compute usign VS_LOG_2. More...
|
|
float | getBestExposure (int nBits, float overlap=0.5f) |
| getBestExposure computes the best interval center. More...
|
|
The Histogram class is a class for creating, managing, loading, and saving histogram for an Image.
◆ Histogram() [1/2]
pic::Histogram::Histogram |
( |
| ) |
|
|
inline |
Histogram is the basic constructor setting variables to defaults.
◆ Histogram() [2/2]
pic::Histogram::Histogram |
( |
Image * |
imgIn, |
|
|
VALUE_SPACE |
type, |
|
|
int |
nBin, |
|
|
int |
channel = 0 |
|
) |
| |
|
inline |
Histogram is an extension of the basic constructor, where calculate is called in order to populate the Histogram.
- Parameters
-
imgIn | is an input image for which Histogram needs to be computed. |
type | is the space of computations (please see calculate()). |
nBin | is the number of bins of the Histogram. |
channel | is the color channel for which Histogram needs to be computed. |
◆ ~Histogram()
pic::Histogram::~Histogram |
( |
| ) |
|
|
inline |
~Histogram is the basic destructor which frees memory.
◆ calculate()
calculate computes the histogram of an input image. In the case of LDR images, they are ssumed to be normalized; i.e. with values in [0, 1]. This function computes the histogram for a single color channel.
- Parameters
-
imgIn | is the input image for which the histogram needs to be computed |
type | is the domain space for histogram computations. Histogram can be computed as: VS_LDR (256 bins), VS_LIN (linear space), VS_LOG_2 (logarithm 2 base), VS_LOG_E (natural logarithm space), and VS_LOG_10 (logarithm 10 base). |
nBin | is the number of bins of the Histogram to be computed. The default value is 256. |
box | is the slice where to compute the histogram. |
channel | is the color channel for which the Histogram will be computed. |
◆ ceiling()
void pic::Histogram::ceiling |
( |
float |
k | ) |
|
|
inline |
ceiling limits the maximum value of the histogram using Ward algorithm.
- Parameters
-
◆ clip()
void pic::Histogram::clip |
( |
uint |
value | ) |
|
|
inline |
clip clips the histogram to value.
- Parameters
-
value | the maximum allowed value in the histogram. |
◆ cumulativef()
float* pic::Histogram::cumulativef |
( |
bool |
bNormalized | ) |
|
|
inline |
cumulativef computes the cumulative Histogram.
- Parameters
-
bNormalized | is a boolean value; if it is true values of the Histogram will be normalized. |
- Returns
- It returns the cumulative Histogram as a float pointer.
◆ exposureCovering()
std::vector< float > pic::Histogram::exposureCovering |
( |
int |
nBits = 8 , |
|
|
float |
overlap = 1.0f |
|
) |
| |
|
inline |
exposureCovering computes the exposure values for fully covering the dynamic range of the image. This function works only if the histogram was compute usign VS_LOG_2.
- Parameters
-
nBits | is the number of bit used for storing each output exposure image. The default value is 8. |
overlap | is the value, in f-stops, of overlapping between two exposure images. This value is set to 1 by default. |
- Returns
- It returns an std::vector<float> which contains the exposure values in f-stops for all required exposures for covering information.
◆ getBestExposure()
float pic::Histogram::getBestExposure |
( |
int |
nBits, |
|
|
float |
overlap = 0.5f |
|
) |
| |
|
inline |
getBestExposure computes the best interval center.
- Parameters
-
nBits | is the number of bits in the budget for the output image. |
- Returns
- It returns the exposure, in f-stops, for setting the image with the best exposure at given dynamic range.
◆ getCumulativef()
float* pic::Histogram::getCumulativef |
( |
| ) |
|
|
inline |
getCumulativef this function returns the cumulative Histogram. Note that cumulativef needs to be computed before otherwise the function will return a NULL pointer.
- Returns
- It returns a float pointer to the cumulative Histogram.
◆ getfMax()
float pic::Histogram::getfMax |
( |
| ) |
|
|
inline |
◆ getfMin()
float pic::Histogram::getfMin |
( |
| ) |
|
|
inline |
◆ getNormalized()
float* pic::Histogram::getNormalized |
( |
bool |
bNor = true | ) |
|
|
inline |
getNormalized normalizes the Histogram.
- Returns
- It returns the normalized Histogram as a float pointer.
◆ getOtsu()
float pic::Histogram::getOtsu |
( |
| ) |
|
|
inline |
◆ project()
int pic::Histogram::project |
( |
float |
x | ) |
|
|
inline |
project converts an input value in the histogram domain.
- Parameters
-
- Returns
- x is projected in the histogram domain.
◆ projectDomain()
float pic::Histogram::projectDomain |
( |
float |
x | ) |
|
|
inlineprotected |
projectDomain applies the histogram domain to x.
- Parameters
-
- Returns
- x is converted into the histogram domain.
◆ release()
void pic::Histogram::release |
( |
| ) |
|
|
inline |
◆ uniform()
void pic::Histogram::uniform |
( |
float |
fMin, |
|
|
float |
fMax, |
|
|
uint |
value, |
|
|
VALUE_SPACE |
type, |
|
|
int |
nBin |
|
) |
| |
|
inline |
◆ unproject()
float pic::Histogram::unproject |
( |
int |
ind | ) |
|
|
inline |
unproject converts a histogram value back to its original domain.
- Parameters
-
- Returns
- ind is converted back to its original domain.
◆ unprojectDomain()
float pic::Histogram::unprojectDomain |
( |
float |
x | ) |
|
|
inlineprotected |
unprojectDomain removes the histogram domain to x.
- Parameters
-
- Returns
- x is converted back to its original domain.
◆ update() [1/2]
void pic::Histogram::update |
( |
float |
x | ) |
|
|
inlineprotected |
◆ update() [2/2]
void pic::Histogram::update |
( |
float |
fMin, |
|
|
float |
fMax |
|
) |
| |
|
inline |
◆ write()
void pic::Histogram::write |
( |
std::string |
name, |
|
|
bool |
bNor |
|
) |
| |
|
inline |
write saves the Histogram as an Image into a file.
- Parameters
-
name | is the filename where to save the Histogram. |
bNor | is a boolean value for normalizing or not the Histogram. |
◆ bin
uint* pic::Histogram::bin |
◆ bin_c
float* pic::Histogram::bin_c |
|
protected |
◆ bin_nor
float* pic::Histogram::bin_nor |
|
protected |
◆ bin_work
uint * pic::Histogram::bin_work |
◆ deltaMaxMin
float pic::Histogram::deltaMaxMin |
|
protected |
◆ epsilon
float pic::Histogram::epsilon |
|
protected |
◆ fMax
float pic::Histogram::fMax |
|
protected |
◆ fMin
float pic::Histogram::fMin |
|
protected |
◆ nBin
◆ nBinf
float pic::Histogram::nBinf |
|
protected |
◆ type
The documentation for this class was generated from the following file:
- C:/Users/Francesco/Documents/GitHub/piccante/include/histogram.hpp