Skip to content

entropy_grayEntropyGrayEntropyGrayentropy_grayentropy_gray🔗

Short description🔗

entropy_grayEntropyGrayEntropyGrayentropy_grayentropy_gray — Determine the entropy and anisotropy of images.

Signature🔗

entropy_gray( region Regions, image Image, out real Entropy, out real Anisotropy )void EntropyGray( const HObject& Regions, const HObject& Image, HTuple* Entropy, HTuple* Anisotropy )static void HOperatorSet.EntropyGray( HObject regions, HObject image, out HTuple entropy, out HTuple anisotropy )def entropy_gray( regions: HObject, image: HObject ) -> Tuple[Sequence[float], Sequence[float]]

def entropy_gray_s( regions: HObject, image: HObject ) -> Tuple[float, float]Herror entropy_gray( const Hobject Regions, const Hobject Image, double* Entropy, double* Anisotropy )

Herror T_entropy_gray( const Hobject Regions, const Hobject Image, Htuple* Entropy, Htuple* Anisotropy )

HTuple HImage::EntropyGray( const HRegion& Regions, HTuple* Anisotropy ) const

double HImage::EntropyGray( const HRegion& Regions, double* Anisotropy ) const

HTuple HRegion::EntropyGray( const HImage& Image, HTuple* Anisotropy ) const

double HRegion::EntropyGray( const HImage& Image, double* Anisotropy ) const

HTuple HImage.EntropyGray( HRegion regions, out HTuple anisotropy )

double HImage.EntropyGray( HRegion regions, out double anisotropy )

HTuple HRegion.EntropyGray( HImage image, out HTuple anisotropy )

double HRegion.EntropyGray( HImage image, out double anisotropy )

Description🔗

The operator entropy_grayEntropyGray 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 Regionsregionsregions according to the following formulae:

Entropy:

\[\begin{eqnarray*} Entropy = - \sum_{0}^{255}{ rel[i] * \log_{2}( rel[i] )} \end{eqnarray*}\]

Anisotropy coefficient:

\[\begin{eqnarray*} Anisotropy = \frac{\sum_{0}^{k}{rel[i] * \log_{2}(rel[i])}}{Entropy} \end{eqnarray*}\]
          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

where

[{\(rel[i]\)}] = Histogram of relative gray value frequencies

[\(i\)] = Gray value of input image \((0 \dots 255)\)

[\(k\)] = Smallest possible gray value with \(\sum_{0}^{k}{rel[i]} \geq 0.5\)

Attention🔗

Note that the operator entropy_grayEntropyGray only considers the given Regionsregionsregions and ignores any previously set domain of the input image Imageimageimage.

Execution information🔗

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

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

Parameters🔗

Regionsregionsregions (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Regions where the features are to be determined.

Imageimageimage (input_object) singlechannelimage → object (byte)HObject (byte)HImage (byte)HObject (byte)Hobject (byte)

Gray value image.

Entropyentropyentropy (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Information content (entropy) of the gray values.

Assertion: 0 <= Entropy && Entropy <= 8

Anisotropyanisotropyanisotropy (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]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_grayEntropyGray returns the value 2 (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 is raised.

Combinations with other operators🔗

Combinations

Alternatives

select_graySelectGray

See also

entropy_imageEntropyImage, gray_histoGrayHisto, gray_histo_absGrayHistoAbs, fuzzy_entropyFuzzyEntropy, fuzzy_perimeterFuzzyPerimeter

Module🔗

Foundation