7#include "GaussianStretch.h"
8#include "GaussianDistribution.h"
30 double lastvalue = histogram.
Minimum();
31 for(
int i = 1; i <= histogram.
Bins() - 1; i++) {
32 double percent = 100.0 * (double)i / (
double)histogram.
Bins();
33 double input = histogram.
Percent(percent);
35 if(lastvalue + DBL_EPSILON > input)
continue;
36 if(fabs(input - lastvalue) < 100.0 * DBL_EPSILON)
continue;
37 double output = dis.InverseCumulativeDistribution(percent);
42 if(histogram.
Maximum() > lastvalue) {
43 if(abs(histogram.
Maximum() - lastvalue) > 100 * DBL_EPSILON) {
gaussian distribution class
Stretch p_stretch
Value of the mean.
double Map(const double value) const
Maps an input value to an output value based on the gaussian distribution.
GaussianStretch(Histogram &histogram, const double mean=0.0, const double standardDeviation=1.0)
Constructs a gaussian stretch object.
Container of a cube histogram.
int Bins() const
Returns the number of bins in the histogram.
double Percent(const double percent) const
Computes and returns the value at X percent of the histogram.
double Minimum() const
Returns the absolute minimum double found in all data passed through the AddData method.
double Maximum() const
Returns the absolute maximum double found in all data passed through the AddData method.
void AddPair(const double input, const double output)
Adds a stretch pair to the list of pairs.
void ClearPairs()
Clears the stretch pairs.
double Map(const double value) const
Maps an input value to an output value based on the stretch pairs and/or special pixel mappings.
This is free and unencumbered software released into the public domain.
Namespace for the standard library.