classPiiHistogramOperation
#include <PiiHistogramOperation.h>
An operation that calculates the histogram of a gray-scale or a color image.
Inherits PiiDefaultOperation
Description
Inputs
Outputs
Properties
|
int
|
The number of distinct levels in the output histogram. |
|
bool
|
Output normalization. |
|
The type or the |
Constructors and destructor
Protected member functions
|
virtual void
|
Called by setState() just before the operation changes to a new state. |
|
int
|
( )
|
|
bool
|
( )
|
|
virtual void
|
( )
Executes one round of processing. |
|
( )
|
|
|
void
|
(
|
|
void
|
(
|
|
void
|
|
Property details
-
int levels
[read, write]The number of distinct levels in the output histogram.
If a non-positive number is given, the maximum value of the image/color channel is found and used (after adding one). For 8 bit gray-scale images, use 256. The default value is 256.
-
bool normalized
[read, write]Output normalization.
If set to
false(the default), the output will be a PiiMatrix<int> in which each column represents the number of times the specific color was encountered. Iftrue, output histograms will be normalized so that they always sum up to unity and represented by PiiMatrix<float>. -
PII_OPERATION_SERIALIZATION_FUNCTION
-
PiiImage::RoiType roiType
[read, write]The type or the
roiinput, if connected.The default value is
AutoRoi.
Function details
-
PiiHistogramOperation
() -
Called by setState() just before the operation changes to a new state.
The function will be called independent of the cause of the state change (internal or external). Derived classes may implement this function to perform whatever functionality is needed when a state changes. The default implementation does nothing.
Reimplemented from PiiBasicOperation.
-
int levels
()[protected] -
bool normalized
()[protected] -
virtual void process
()[protected, virtual]Executes one round of processing.
This function is invoked by the processor if the necessary preconditions for a new processing round are met. This function does all the necessary calculations to create output objects and sends them to output sockets.
Calls to process(), syncEvent(), and setProperty() are synchronized and cannot occur simultaneously. PiiDefaultOperation ensures this by locking processLock() for reading before calling process().
Note: With time-consuming operations, one should occasionally check that the operation hasn't been interrupted, i.e. that state() returns
Running.Exceptions
- PiiExecutionException
-
whenever an unrecoverable error occurs during a processing round, the operation is interrupted, or finishes execution due to end of input data.
Reimplemented from PiiDefaultOperation.
-
-
void setLevels
(- int levels
[protected] -
void setNormalized
(- bool normalize
[protected] -
Add a note
Not a single note added yet. Be the first, add yours.