Herror ::entropy_gray (
    Hobject Regions,
    Hobject Image,
    double *Entropy,
    double *Anisotropy
)
Herror ::entropy_gray (
    Hobject Regions,
    Hobject Image,
    HTuple *Entropy,
    HTuple *Anisotropy
)
double HRegion::EntropyGray (
    const HImage &Image,
    double *Anisotropy
) const
HTuple HRegionArray::EntropyGray (
    const HImage &Image,
    HTuple *Anisotropy
) const

Determine the entropy and anisotropy of images.

The operator ::entropy_gray creates the histogram of relative frequencies of the gray values in the input image and calculates from these frequencies the entropy and the anisotropy coefficient for each region from Regions according to the following formulae:

    Entropy:
				   255
				   ----
				   \
		  Entropy  =     - /     rel[i]  *  ld(rel[i])
				   ----
				    0

    Anisotropiy coefficient:
				    k
				   ----
				   \
				   /     rel[i]  *  ld(rel[i])
				   ----
				    0
		  Anisotropy  =  -----------------------------
					  Entropy

	  where
		  rel[i]  histogram of relative gray value frequencies
		  i       Gray value of input image (0..255)
	  and     k       Smallest possible gray value with sum(rel[i]) >= 0.5


Parameters

Regions (input_object)
region(-array) -> Hobject: HRegion(Array)
Regions where the features are to be determined.

Image (input_object)
image -> Hobject: HImage ( byte )
Gray value image.

Entropy (output_control)
real(-array) -> (HTuple.) double *
Information content (entropy) of the gray values.
Assertion: (0 <= Entropy) && (Entropy <= 8)

Anisotropy (output_control)
real(-array) -> (HTuple.) double *
Measure of the symmetry of gray value distribution.


Complexity

If F is the area of the region the runtime complexity is O(F + 255).


Result

The operator ::entropy_gray returns the value H_MSG_TRUE if an image with defined gray values is entered 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>), the behavior in case of empty region is set via ::set_system('empty_region_result',<Result>). If necessary an exception handling is raised.


Alternatives

::select_gray


See also

::entropy_image, ::gray_histo, ::fuzzy_entropy, ::fuzzy_perimeter


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH