Skip to content

cooc_feature_matrixCoocFeatureMatrixCoocFeatureMatrixcooc_feature_matrixcooc_feature_matrix🔗

Short description🔗

cooc_feature_matrixCoocFeatureMatrixCoocFeatureMatrixcooc_feature_matrixcooc_feature_matrix — Calculate gray value features from a co-occurrence matrix.

Signature🔗

cooc_feature_matrix( image CoocMatrix, out real Energy, out real Correlation, out real Homogeneity, out real Contrast )void CoocFeatureMatrix( const HObject& CoocMatrix, HTuple* Energy, HTuple* Correlation, HTuple* Homogeneity, HTuple* Contrast )static void HOperatorSet.CoocFeatureMatrix( HObject coocMatrix, out HTuple energy, out HTuple correlation, out HTuple homogeneity, out HTuple contrast )def cooc_feature_matrix( cooc_matrix: HObject ) -> Tuple[float, float, float, float]

Herror cooc_feature_matrix( const Hobject CoocMatrix, double* Energy, double* Correlation, double* Homogeneity, double* Contrast )

Herror T_cooc_feature_matrix( const Hobject CoocMatrix, Htuple* Energy, Htuple* Correlation, Htuple* Homogeneity, Htuple* Contrast )

double HImage::CoocFeatureMatrix( double* Correlation, double* Homogeneity, double* Contrast ) const

double HImage.CoocFeatureMatrix( out double correlation, out double homogeneity, out double contrast )

Description🔗

The operator cooc_feature_matrixCoocFeatureMatrix calculates from a co-occurrence matrix (CoocMatrixcoocMatrixcooc_matrix) the energy (Energyenergyenergy), correlation (Correlationcorrelationcorrelation), local homogeneity (Homogeneityhomogeneityhomogeneity) and contrast (Contrastcontrastcontrast).

The operator cooc_feature_matrixCoocFeatureMatrix calculates the gray value features from the part of the input matrix generated by gen_cooc_matrixGenCoocMatrix corresponding to the direction matrix indicated by the parameters LdGrayldGrayld_gray and Directiondirectiondirection according to the following formulae:

  • Energy (Measure for image homogeneity): \(\textrm{Energy} = \sum_{i,j=0}^{width}{c_{ij}^2}\)

  • Correlation (Measure for gray value dependencies): \(\textrm{Correlation} = \frac{\sum_{i,j=0}^{width} {{( i - u_{x} ) ( j - u_{y} ) c_{ij}}}}{s_{x} s_{y}}\)

  • Local homogeneity: \(\textrm{Homogeneity} = \sum_{i,j=0}^{width}{ \frac{1}{ 1 + ( i - j )^2} c_{ij}}\)

  • Contrast (Measure for the size of the intensity differences): \(\textrm{Contrast} = \sum_{i,j=0}^{width} {( i - j )^2 c_{ij}}\)

where

  • \(width =\) Width of CoocMatrixcoocMatrixcooc_matrix,

  • \(c_{ij}\) Entry of co-occurrence matrix,

  • \(u_{x} = \sum_{i,j=0}^{width}{ i *c_{ij}}\),

  • \(u_{y} = \sum_{i,j=0}^{width}{ j *c_{ij}}\),

  • \(s_{x}^2 = \sum_{i,j=0}^{width}{ (i - u_{x})^2 * c_{ij}}\),

  • \(s_{y}^2 = \sum_{i,j=0}^{width}{ (i - u_{y})^2 * c_{ij}}\).

Attention🔗

The region of the input image is disregarded.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

Parameters🔗

CoocMatrixcoocMatrixcooc_matrix (input_object) singlechannelimage(-array) → object (real)HObject (real)HImage (real)HObject (real)Hobject (real)

Co-occurrence matrix.

Energyenergyenergy (output_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

Homogeneity of the gray values.

Correlationcorrelationcorrelation (output_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

Correlation of gray values.

Homogeneityhomogeneityhomogeneity (output_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

Local homogeneity of gray values.

Contrastcontrastcontrast (output_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

Gray value contrast.

Result🔗

The operator cooc_feature_matrixCoocFeatureMatrix returns the value 2 (H_MSG_TRUE) if an image with defined gray values is passed and the parameters are correct. The behavior in case of empty input (no input images available) is set via the operator set_system(::'no_object_result',<Result>:). If necessary an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

gen_cooc_matrixGenCoocMatrix

Alternatives

cooc_feature_imageCoocFeatureImage

See also

intensityIntensity, min_max_grayMinMaxGray, entropy_grayEntropyGray, select_graySelectGray

Module🔗

Foundation