Cooccurrence
This attribute manages measurements belonging to the Cooccurrence category of native measurements.
More information about co-occurrence matrices is available in the Cooccurrence2d documentation.
All measurements available in the Cooccurrence category are customizable with the following methods.
More information about co-occurrence matrices is available in the Cooccurrence2d documentation.
All measurements available in the Cooccurrence category are customizable with the following methods.
Syntax
Method | Description |
---|---|
void setAutoAdjusted( bool autoAdjusted ) | Enables or disables the automatic computation of the joint histogram range. |
bool isAutoAdjusted() | Returns true if the range of the joint histogram is automatically determined, false otherwise. |
void setBinSize( float size ) | Sets the histogram bin size. It must be strictly positive. It is ignored when the automatic mode is disabled. |
float binSize() | Returns the bin size of the joint histogram. This parameter is ignored is the automatic mode is disabled. |
void setMinIntensity( float value ) | Sets the minimum gray level value used to compute the joint histogram. This parameter is ignored if the automatic mode is disabled. |
float minIntensity() | Returns the minimum gray level value used to compute the joint histogram. This parameter is ignored if the automatic mode is disabled. |
void setMaxIntensity( float value ) | Sets the maximum gray level value used to compute the joint histogram. This parameter is ignored if the automatic mode is disabled. |
float maxIntensity() | Returns the maximum gray level value used to compute the joint histogram. This parameter is ignored if the automatic mode is disabled. |
void setVectorCount( size_t number ) | Sets the number of offset vectors; that is, the number of cooccurrence matrices to compute. |
size_t vectorCount() | Returns the number of offset vectors; that is, the number of cooccurrence matrices to compute. |
void addVector( int32_t x, int32_t y ) | Adds an offset vector defined by x and y displacements in pixels. This vector is not pushed to the end of the list, but inserted at a position sorting the list in ascending order of x then y. The y displacement cannot be negative. If a vector →v is added with a negative y offset, it is automatically replaced by −→v which gives the same cooccurrence matrix. |
iolink::Vector2i32 vector( int32_t index ) | Returns the offset vector at the index position. |
Cooccurrence::Ptr cooc = MeasurementAttributes::cooccurrence(); cooc->setVectorCount( 1 ); int vectorNumberValue = cooc->vectorCount(); cooc->addVector( 10, 20 ); iolink::Vector2i32 vectorValue = cooc->vector( 1 ); cooc->setAutoAdjusted( false ); bool valueAutoAdjusted = cooc->isAutoAdjusted()(); cooc->setBinSize( 2 ); float valueBinSize = cooc->binSize(); cooc->setMinIntensity( 5 ); float valueMinValue = cooc->minIntensity(); cooc->setMaxIntensity( 200 ); float valueMaxValue = cooc->maxIntensity();