PCL
|
Discrete image histogram function. More...
#include <Histogram.h>
Public Types | |
using | count_type = uint64 |
using | histogram_type = UI64Vector |
Public Member Functions | |
Histogram (const Histogram &)=default | |
Histogram (const histogram_type &data) | |
Histogram (Histogram &&)=default | |
Histogram (int resolution=0x10000L) | |
~Histogram () override | |
void | Allocate () |
void | Assign (const Histogram &x) |
void | Clear () |
void | ClearRectangle () |
void | ClearSelectedChannel () |
int | ClipHigh (count_type n) const |
int | ClipLow (count_type n) const |
count_type | Count () const |
count_type | Count (int i) const |
count_type | Count (int i, int j) const |
double | Entropy () const |
void | GetData (count_type *where, int fromLevel=0, int toLevel=-1) const |
void | GetHistogramRange (int &i, int &j, double a, double b) const |
void | GetNormalizedRange (double &a, double &b, int i, int j) const |
const histogram_type & | HistogramData () const |
int | HistogramLevel (double x) const |
bool | IsEmpty () const |
int | LastLevel () const |
double | NormalizedClipHigh (count_type n) const |
double | NormalizedClipLow (count_type n) const |
double | NormalizedLevel (int i) const |
double | NormalizedPeakLevel () const |
const DImage & | operator<< (const DImage &) |
const Image & | operator<< (const Image &) |
const ImageVariant & | operator<< (const ImageVariant &) |
const UInt16Image & | operator<< (const UInt16Image &) |
const UInt32Image & | operator<< (const UInt32Image &) |
const UInt8Image & | operator<< (const UInt8Image &) |
Histogram & | operator= (const Histogram &)=default |
Histogram & | operator= (Histogram &&)=default |
count_type | operator[] (int i) const |
count_type | PeakCount () const |
count_type | PeakCount (int i, int j) const |
int | PeakLevel () const |
void | Resample (Histogram &h) const |
int | Resolution () const |
void | SelectChannel (int channel) |
int | SelectedChannel () const |
const Rect & | SelectedRectangle () const |
void | SelectRectangle (const Rect &r) |
void | SetHistogramData (const histogram_type &data) |
void | SetResolution (int resolution) |
int | UpdatePeakLevel () |
Public Member Functions inherited from pcl::ParallelProcess | |
ParallelProcess ()=default | |
ParallelProcess (const ParallelProcess &)=default | |
virtual | ~ParallelProcess () |
void | DisableParallelProcessing (bool disable=true) noexcept |
void | EnableParallelProcessing (bool enable=true, int maxProcessors=0) noexcept |
bool | IsParallelProcessingEnabled () const noexcept |
int | MaxProcessors () const noexcept |
ParallelProcess & | operator= (const ParallelProcess &)=default |
void | SetMaxProcessors (int maxProcessors) noexcept |
void | Swap (ParallelProcess &process) noexcept |
Definition at line 75 of file Histogram.h.
using pcl::Histogram::count_type = uint64 |
Represents a histogram bin count, or the value of the discrete histogram function at a specific abscissa or range of abscissae.
Definition at line 83 of file Histogram.h.
A vector of histogram bin counts, which is the type used internally to store the values of the discrete histogram function.
Definition at line 89 of file Histogram.h.
|
inline |
Constructs an empty Histogram object with the specified resolution.
The resolution of a histogram function is the number of discrete intervals (or bins) used to analyze image data. The minimum possible resolution is 2. In PCL, the default resolution is 2^16 = 65536 intervals (also known as a 16-bit histogram).
Definition at line 99 of file Histogram.h.
|
inline |
Constructs a Histogram object by importing a copy of the specified data vector as its internal vector of histogram function values. Automatically sets the histogram resolution equal to the length of the data vector, and calculates the peak level of the newly constructed histogram.
If the specified data vector has less than two components, this constructor will yield an empty histogram with the default 16-bit resolution.
Definition at line 116 of file Histogram.h.
|
default |
Copy constructor.
|
default |
Move constructor.
|
inlineoverride |
Destroys a Histogram object.
Definition at line 134 of file Histogram.h.
|
inline |
If this histogram object is empty, this member function allocates the internal vector of histogram function values. Newly allocated vectors are not initialized, so the histogram will contain unpredictable values after calling this function.
If the histogram is not empty, calling this function has no effect.
Definition at line 222 of file Histogram.h.
Referenced by Resample().
|
inline |
Assigns another Histogram object x to this object.
Definition at line 151 of file Histogram.h.
|
inline |
Deallocates the internal vector of histogram values, yielding an empty Histogram object.
Definition at line 160 of file Histogram.h.
Referenced by Resample().
|
inline |
Clears the rectangular selection in this Histogram object.
After calling this function, histograms will be calculated for the current rectangular selection of the target image.
Definition at line 602 of file Histogram.h.
|
inline |
Clears the channel index selection in this Histogram object.
After calling this function, histograms will be calculated for the current selected channel of the target image.
Definition at line 636 of file Histogram.h.
|
inline |
Returns the discrete histogram level where the sum of counts for its succeding levels is greater than or equal to the specified amount n.
This function is useful to compute an automatic histogram highlights clipping point. The returned index is the position of the highlights clipping point that clips (sets to white) the specified amount of image pixel samples
Definition at line 418 of file Histogram.h.
|
inline |
Returns the discrete histogram level where the sum of counts for its preceding levels is greater than or equal to the specified amount n.
This function is useful to compute an automatic histogram shadows clipping point. The returned index is the position of the shadows clipping point that clips (sets to black) the specified amount of image pixel samples
Definition at line 392 of file Histogram.h.
|
inline |
Returns the total sum of the counts in all histogram intervals, or the sum of all discrete histogram function values. If this Histogram object is empty, this function returns zero.
Definition at line 312 of file Histogram.h.
|
inline |
Returns the histogram count, or the value of the histogram function, at the specified discrete level i.
Definition at line 321 of file Histogram.h.
|
inline |
Returns the sum of counts in the specified interval of discrete histogram levels i, j.
Definition at line 341 of file Histogram.h.
References pcl::Range(), pcl::Sum(), and pcl::Swap().
|
inline |
Computes the discrete entropy of this histogram.
The returned value is normalized to the total weight of the histogram, that is, it is independent on the total number of counts stored in the histogram data vector.
Definition at line 527 of file Histogram.h.
|
inline |
Definition at line 471 of file Histogram.h.
References pcl::Range(), and pcl::Swap().
|
inline |
Converts the specified normalized levels a, b in the [0,1] range to discrete histogram levels i, j, respectively.
Definition at line 287 of file Histogram.h.
|
inline |
Converts the specified discrete histogram levels i, j to normalized levels a, b, respectively, in the [0,1] range.
Definition at line 299 of file Histogram.h.
|
inline |
Returns a reference to the immutable internal vector of histogram function values.
Definition at line 439 of file Histogram.h.
|
inline |
Returns the index of the discrete level in this Histogram object corresponding to the specified normalized level x in the [0,1] range.
Definition at line 267 of file Histogram.h.
References pcl::Range(), and pcl::RoundInt().
|
inline |
Returns true iff this Histogram object is empty. An empty histogram has no computed histogram values.
Definition at line 170 of file Histogram.h.
|
inline |
Returns the highest valid discrete histogram level, or Resolution()-1.
Definition at line 191 of file Histogram.h.
|
inline |
Returns the normalized histogram level (in the [0,1] range) where the sum of counts for its succeding levels is greater than or equal to the specified amount n.
Definition at line 430 of file Histogram.h.
|
inline |
Returns the normalized histogram level (in the [0,1] range) where the sum of counts for its preceding levels is greater than or equal to the specified amount n.
Definition at line 404 of file Histogram.h.
|
inline |
Returns the normalized histogram level in the [0,1] range corresponding to the specified discrete level i in this Histogram object.
Definition at line 277 of file Histogram.h.
References pcl::Range().
|
inline |
Returns the histogram peak level as a floating point number normalized to the [0,1] range. See PeakLevel().
Definition at line 245 of file Histogram.h.
Computes the histogram function of a 64-bit floating point real image.
Computes the histogram function of a 32-bit floating point real image.
const ImageVariant& pcl::Histogram::operator<< | ( | const ImageVariant & | ) |
Computes the histogram function of the image transported by an ImageVariant object.
const UInt16Image& pcl::Histogram::operator<< | ( | const UInt16Image & | ) |
Computes the histogram function of a 16-bit unsigned integer image.
const UInt32Image& pcl::Histogram::operator<< | ( | const UInt32Image & | ) |
Computes the histogram function of a 32-bit unsigned integer image.
const UInt8Image& pcl::Histogram::operator<< | ( | const UInt8Image & | ) |
Computes the histogram function of an 8-bit unsigned integer image.
Copy assignment operator. Returns a reference to this object.
Move assignment operator. Returns a reference to this object.
|
inline |
Subscript operator. Equivalent to Count( int ).
Definition at line 332 of file Histogram.h.
References pcl::Count().
|
inline |
Returns the histogram function value for the bin at the current peak level. Typically, the peak count is used to normalize the histogram to a prescribed range. For example, by dividing all histogram function values by the peak count the entire histogram will be normalized to the [0,1] range.
Definition at line 361 of file Histogram.h.
References pcl::Count().
|
inline |
Returns the peak count, or the maximum histogram function value, within the specified range [i,j] of discrete histogram intervals.
Definition at line 370 of file Histogram.h.
References pcl::MaxItem(), pcl::Range(), and pcl::Swap().
|
inline |
Returns the current peak level of the histogram. If this histogram is empty, the peak level is zero conventionally.
The peak level is simply the index (or integer abscissa) of the histogram bin with the largest count, or the position on the X axis of the maximum of the histogram function, in the discrete range [0,LastLevel()].
Definition at line 236 of file Histogram.h.
|
inline |
Remaps the histogram function to fit the resolution of a target histogram h.
If the target histogram has the same resolution as this object, this member function is equivalent to a plain assignment. If the resolutions differ, if this histogram is empty then the target histogram is deallocated and cleared, otherwise the target histogram is recomputed as a resampled version of this histogram.
This member function is useful to generate reduced versions of a histogram. It can also be used to generate bootstrap samples from an existing histogram function.
Definition at line 500 of file Histogram.h.
References Allocate(), pcl::GenericVector< T >::Begin(), Clear(), pcl::GenericVector< T >::End(), pcl::GenericVector< T >::Length(), pcl::MaxItem(), and pcl::RoundInt().
|
inline |
Returns the current resolution of this Histogram object.
The resolution of a histogram function is the number of discrete intervals (or bins) used to analyze image data. The minimum possible resolution is 2. In PCL, the default resolution is 2^16 = 65536 intervals (also known as a 16-bit histogram).
Definition at line 183 of file Histogram.h.
|
inline |
Selects a channel index for this Histogram object.
When a positive (>= 0) channel index is specified, it is used for calculation of histograms. If a negative channel index is specified, the current selected channel in the target image will be used.
Definition at line 625 of file Histogram.h.
|
inline |
Returns the current channel index selected in this Histogram object.
By default, the selected channel index is -1, meaning that the channel selected in the target image will be used.
Definition at line 613 of file Histogram.h.
|
inline |
Returns the current rectangular selection in this Histogram object.
By default, the rectangular selection is an empy rectangle, meaning that the rectangular selection in the target image will be used.
Definition at line 578 of file Histogram.h.
|
inline |
Sets a new rectangular selection for this Histogram object.
When a non-empty rectangular selection is specified, it is used as the region of interest (ROI) for calculation of histograms. If an empty or invalid rectangle is specified, the current selection in the target image will be used.
Definition at line 591 of file Histogram.h.
|
inline |
Causes this Histogram object to import a copy of the specified data vector as its internal vector of histogram function values. Automatically sets the histogram resolution equal to the length of the data vector, and recalculates the peak level of the new histogram.
If the specified data vector has less than two components, this member function will yield an empty histogram without changing the current histogram resolution.
Definition at line 454 of file Histogram.h.
References pcl::GenericVector< T >::Length().
|
inline |
Sets the resolution of this Histogram object.
The resolution of a histogram function is the number of discrete intervals (or bins) used to analyze image data. The minimum possible resolution is 2. In PCL, the default resolution is 2^16 = 65536 intervals (also known as a 16-bit histogram).
After calling this member function, the histogram will be empty and the internal vector of histogram function values will be deallocated.
Definition at line 207 of file Histogram.h.
|
inline |
Recalculates the histogram peak level from current histogram function values. If the histogram is empty, the peak level is reset to zero conventionally.
Returns the newly calculated histogram peak level.
Definition at line 257 of file Histogram.h.
References pcl::MaxItem().