Herror ::cooc_feature_matrix (
    Hobject CoocMatrix,
    double *Energy,
    double *Correlation,
    double *Homogenity,
    double *Contrast
)
HTuple HImage::CoocFeatureMatrix (
    HTuple *Correlation,
    HTuple *Homogenity,
    HTuple *Contrast
) const

Calculate gray value features from a co-occurrence matrix.

The procedure calculates from a co-occurence matrix (CoocMatrix) the energy (Energy), correlation (Correlation), local homogenity (Homogenity) and contrast (Contrast).

The operator ::cooc_feature_matrix calculates the gray value features from the part of the input matrix generated by ::gen_cooc_matrix corresponding to the direction matrix indicated by the parameters LdGray and Direction according to the following formulae:

  Energy:
				width   width
				----    ----
				\       \
		Energy  =       /       /     cij  *  cij
				----    ----
				i=0     j=0

				(Measure for image homogenity)

  Correlation:
				width  width
				----   ----
				\      \
				/      /      (i - ux) * (j - uy) * cij
				----   ----
				i=0    j=0
		Correlation  =  -----------------------------------------
					       sx  *  sy

				(Measure for gray value dependencies)

  Local homogenity:

				width  width
				----   ----
				\      \
		Homogenity  =   /      /      (1 / (1+(i - j) * (i - j)) * cij
				----   ----
				i=0    j=0


  Contrast:

				width   width
				----    ----
				\       \
		Contrast  =     /       /     (i - j)  *  (i - j)  *  cij
				----    ----
				i=0     j=0

			(Measure for the size of the intensity differences)

	where

		width           2^LdGray - 1

		cij             Entry of co-occurrence matrix

				width   width
				----    ----
				\       \
		ux              /       /     i  *  cij
				----    ----
				i=0     j=0

				width   width
				----    ----
				\       \
		uy              /       /     j  *  cij
				----    ----
				i=0     j=0

				width   width
				----    ----
				\       \
		sx^2            /       /     (i - ux)^2  * cij
				----    ----
				i=0     j=0

				width   width
				----    ----
				\       \
		sy^2            /       /     (i - uy)^2  *  cij
				----    ----
				i=0     j=0


Attention

The region of the input image is disregarded.


Parameters

CoocMatrix (input_object)
image -> Hobject: HImage ( int4 )
Co-occurrence matrix.

Energy (output_control)
real -> double *
Homogenity of the gray values.

Correlation (output_control)
real -> double *
Correlation of gray values.

Homogenity (output_control)
real -> double *
Local homogenity of gray values.

Contrast (output_control)
real -> double *
Gray value contrast.


Result

The operator ::cooc_feature_matrix returns the value 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 handling is raised.


Possible Predecessors

::gen_cooc_matrix


Alternatives

::cooc_feature_image


See also

::intensity, ::min_max_gray, ::entropy_gray, ::select_gray


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH