Operator Reference

entropy_imageentropy_imageEntropyImageEntropyImageentropy_image (Operator)

entropy_imageentropy_imageEntropyImageEntropyImageentropy_image — Calculate the entropy of gray values within a rectangular window.

Signature

entropy_image(Image : ImageEntropy : Width, Height : )

Herror entropy_image(const Hobject Image, Hobject* ImageEntropy, const Hlong Width, const Hlong Height)

Herror T_entropy_image(const Hobject Image, Hobject* ImageEntropy, const Htuple Width, const Htuple Height)

void EntropyImage(const HObject& Image, HObject* ImageEntropy, const HTuple& Width, const HTuple& Height)

HImage HImage::EntropyImage(Hlong Width, Hlong Height) const

static void HOperatorSet.EntropyImage(HObject image, out HObject imageEntropy, HTuple width, HTuple height)

HImage HImage.EntropyImage(int width, int height)

def entropy_image(image: HObject, width: int, height: int) -> HObject

Description

entropy_imageentropy_imageEntropyImageEntropyImageentropy_image calculates the entropy of gray values in the image ImageImageImageimageimage within a rectangular mask of size (HeightHeightHeightheightheight, WidthWidthWidthwidthwidth). The resulting image is returned in ImageEntropyImageEntropyImageEntropyimageEntropyimage_entropy, in which the entropy is multiplied by 32. If the parameters HeightHeightHeightheightheight and WidthWidthWidthwidthwidth are even, they are changed to the next larger odd value. At the image borders the gray values are mirrored.

Attention

Note that filter operators may return unexpected results if an image with a reduced domain is used as input. Please refer to the chapter Filters.

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.
  • Automatically parallelized on channel level.
  • Automatically parallelized on domain level.

Parameters

ImageImageImageimageimage (input_object)  (multichannel-)image(-array) objectHImageHObjectHObjectHobject (byte)

Image for which the entropy is to be calculated.

ImageEntropyImageEntropyImageEntropyimageEntropyimage_entropy (output_object)  (multichannel-)image(-array) objectHImageHObjectHObjectHobject * (byte)

Entropy image.

WidthWidthWidthwidthwidth (input_control)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width of the mask in which the entropy is calculated.

Default: 9

Suggested values: 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25

Restriction: 3 <= Width && odd(Width)

HeightHeightHeightheightheight (input_control)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Height of the mask in which the entropy is calculated.

Default: 9

Suggested values: 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25

Restriction: 3 <= Height && odd(Height)

Example (HDevelop)

read_image(Image,'fabrik')
dev_display(Image)
entropy_image(Image,Entropy,9,9)
dev_display(Entropy)

Example (C)

read_image(&Image,"fabrik");
disp_image(Image,WindowHandle);
entropy_image(Image,&Entropy,9,9);
disp_image(Entropy,WindowHandle); 

Example (HDevelop)

read_image(Image,'fabrik')
dev_display(Image)
entropy_image(Image,Entropy,9,9)
dev_display(Entropy)

Example (HDevelop)

read_image(Image,'fabrik')
dev_display(Image)
entropy_image(Image,Entropy,9,9)
dev_display(Entropy)

Result

entropy_imageentropy_imageEntropyImageEntropyImageentropy_image returns 2 ( H_MSG_TRUE) if all parameters are correct. If the input is empty the behavior can be set via set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>). If necessary, an exception is raised.

Possible Successors

disp_imagedisp_imageDispImageDispImagedisp_image

Alternatives

entropy_grayentropy_grayEntropyGrayEntropyGrayentropy_gray

See also

energy_gaborenergy_gaborEnergyGaborEnergyGaborenergy_gabor, entropy_grayentropy_grayEntropyGrayEntropyGrayentropy_gray

Module

Foundation