Operator Reference

deviation_imagedeviation_imageDeviationImageDeviationImagedeviation_image (Operator)

deviation_imagedeviation_imageDeviationImageDeviationImagedeviation_image — Calculate the standard deviation of gray values within rectangular windows.

Signature

deviation_image(Image : ImageDeviation : Width, Height : )

Herror deviation_image(const Hobject Image, Hobject* ImageDeviation, const Hlong Width, const Hlong Height)

Herror T_deviation_image(const Hobject Image, Hobject* ImageDeviation, const Htuple Width, const Htuple Height)

void DeviationImage(const HObject& Image, HObject* ImageDeviation, const HTuple& Width, const HTuple& Height)

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

static void HOperatorSet.DeviationImage(HObject image, out HObject imageDeviation, HTuple width, HTuple height)

HImage HImage.DeviationImage(int width, int height)

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

Description

deviation_imagedeviation_imageDeviationImageDeviationImagedeviation_image calculates the standard deviation of gray values in the image ImageImageImageimageimage within a rectangular mask of size (HeightHeightHeightheightheight, WidthWidthWidthwidthwidth). The resulting image is returned in ImageDeviationImageDeviationImageDeviationimageDeviationimage_deviation. To better use the range of gray values available in the output image, the result is multiplied by 2. 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

deviation_imagedeviation_imageDeviationImageDeviationImagedeviation_image can be executed on OpenCL devices. As the same OpenCL code is used, the same limitations as for mean_imagemean_imageMeanImageMeanImagemean_image apply. Since deviation_imagedeviation_imageDeviationImageDeviationImagedeviation_image uses single precision floating point arithmetic internally, the results may differ slightly from the CPU version.

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

  • Supports OpenCL compute devices.
  • 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* / int4* / real* / int2* / uint2*) *allowed for compute devices

Image for which the standard deviation is to be calculated.

ImageDeviationImageDeviationImageDeviationimageDeviationimage_deviation (output_object)  image(-array) objectHImageHObjectHObjectHobject * (byte / int4 / real / int2 / uint2)

Image containing the standard deviation.

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

Width of the mask in which the standard deviation is calculated.

Default: 11

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

Restriction: 3 <= Width && odd(Width) && Width < width(Image) * 2

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

Height of the mask in which the standard deviation is calculated.

Default: 11

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

Restriction: 3 <= Height && odd(Height) && Height < height(Image) * 2

Example (HDevelop)

read_image(Image,'fabrik')
dev_display(Image)
deviation_image(Image,Deviation,9,9)
dev_display(Image)

Example (C)

read_image(&Image,"fabrik");
disp_image(Image,WindowHandle);
deviation_image(Image,&Deviation,9,9);
disp_image(Deviation,WindowHandle); 

Example (HDevelop)

read_image(Image,'fabrik')
dev_display(Image)
deviation_image(Image,Deviation,9,9)
dev_display(Image)

Example (HDevelop)

read_image(Image,'fabrik')
dev_display(Image)
deviation_image(Image,Deviation,9,9)
dev_display(Image)

Result

deviation_imagedeviation_imageDeviationImageDeviationImagedeviation_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_imageentropy_imageEntropyImageEntropyImageentropy_image, entropy_grayentropy_grayEntropyGrayEntropyGrayentropy_gray

See also

convol_imageconvol_imageConvolImageConvolImageconvol_image, texture_lawstexture_lawsTextureLawsTextureLawstexture_laws, intensityintensityIntensityIntensityintensity

Module

Foundation