Skip to content

gray_histo_absGrayHistoAbsGrayHistoAbsgray_histo_absT_gray_histo_abs🔗

Short description🔗

gray_histo_absGrayHistoAbsGrayHistoAbsgray_histo_absT_gray_histo_abs — Calculate the gray value distribution.

Signature🔗

gray_histo_abs( region Region, image Image, number Quantization, out histogram AbsoluteHisto )void GrayHistoAbs( const HObject& Region, const HObject& Image, const HTuple& Quantization, HTuple* AbsoluteHisto )static void HOperatorSet.GrayHistoAbs( HObject region, HObject image, HTuple quantization, out HTuple absoluteHisto )def gray_histo_abs( region: HObject, image: HObject, quantization: Union[int, float] ) -> Sequence[int]

Herror T_gray_histo_abs( const Hobject Region, const Hobject Image, const Htuple Quantization, Htuple* AbsoluteHisto )

HTuple HImage::GrayHistoAbs( const HRegion& Region, const HTuple& Quantization ) const

HTuple HImage::GrayHistoAbs( const HRegion& Region, double Quantization ) const

HTuple HRegion::GrayHistoAbs( const HImage& Image, const HTuple& Quantization ) const

HTuple HRegion::GrayHistoAbs( const HImage& Image, double Quantization ) const

HTuple HImage.GrayHistoAbs( HRegion region, HTuple quantization )

HTuple HImage.GrayHistoAbs( HRegion region, double quantization )

HTuple HRegion.GrayHistoAbs( HImage image, HTuple quantization )

HTuple HRegion.GrayHistoAbs( HImage image, double quantization )

Description🔗

The operator gray_histo_absGrayHistoAbs calculates for the image (Imageimageimage) within Regionregionregion the absolute (AbsoluteHistoabsoluteHistoabsolute_histo) ) histogram of the gray values.

The parameter Quantizationquantizationquantization defines, how many frequencies of neighbored gray values are added for one frequency value. The resulting histogram AbsoluteHistoabsoluteHistoabsolute_histo is a tuple, whose indices are mapped on the gray values of the input image Imageimageimage and whose elements contain the frequencies of the gray values. The indices \(i\) of the frequency value are calculated from the gray values \(g\) and the quantization \(q\) as follows:

  • For unsigned image types:

    \[\begin{eqnarray*} i = \left\lceil {\frac{g+0.5}{q}}\right\rceil \end{eqnarray*}\]
  • For signed image types:

    \[\begin{eqnarray*} i = \left\lceil {\frac{g-(MIN-0.5)}{q}}\right\rceil \end{eqnarray*}\]

whereas MIN denotes the minimal gray value, e.g., -128 for an int1 image type. Therefore, the size of the tuple results from the ratio of the full domain of gray values and the quantization, e.g., for images of int2 in \(\lceil \frac{65536}{3.0} \rceil = 21846\). The origin gray value of the signed image types int1 resp. int2 is mapped on the index 128 resp. 32768, negative resp. positive gray values have smaller resp. greater indices.

Attention🔗

Note that the operator gray_histo_absGrayHistoAbs only considers the given Regionregionregion 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).

  • Automatically parallelized on internal data level.

Parameters🔗

Regionregionregion (input_object) region → objectHObjectHRegionHObjectHobject

Region in which the histogram is to be calculated.

Imageimageimage (input_object) singlechannelimage → object (byte / cyclic / direction / int1 / int2 / uint2)HObject (byte / cyclic / direction / int1 / int2 / uint2)HImage (byte / cyclic / direction / int1 / int2 / uint2)HObject (byte / cyclic / direction / int1 / int2 / uint2)Hobject (byte / cyclic / direction / int1 / int2 / uint2)

Image the gray value distribution of which is to be calculated.

Quantizationquantizationquantization (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Quantization of the gray values.

Default: 1.01.0
Suggested values: 1.0, 2.0, 3.0, 5.0, 10.01.0, 2.0, 3.0, 5.0, 10.0
Restriction: Quantization >= 1.0

AbsoluteHistoabsoluteHistoabsolute_histo (output_control) histogram-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Absolute frequencies of the gray values.

Result🔗

The operator gray_histo_absGrayHistoAbs returns the value 2 (H_MSG_TRUE) if the image has defined gray values 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

Possible successors

histo_to_threshHistoToThresh, gen_region_histoGenRegionHisto

Alternatives

min_max_grayMinMaxGray, intensityIntensity, gray_histoGrayHisto, gray_histo_rangeGrayHistoRange

See also

disp_imageDispImage, histo_2dimHisto2dim, scale_image_maxScaleImageMax, entropy_grayEntropyGray

Module🔗

Foundation