ClassesClasses | | Operators

gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRange (Operator)

Name

gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRange — Calculate the gray value distribution of a single channel image within a certain gray value range.

Signature

gray_histo_range(Regions, Image : : Min, Max, NumBins : Histo, BinSize)

Herror gray_histo_range(const Hobject Regions, const Hobject Image, double Min, double Max, const Hlong NumBins, Hlong* Histo, double* BinSize)

Herror T_gray_histo_range(const Hobject Regions, const Hobject Image, const Htuple Min, const Htuple Max, const Htuple NumBins, Htuple* Histo, Htuple* BinSize)

void GrayHistoRange(const HObject& Regions, const HObject& Image, const HTuple& Min, const HTuple& Max, const HTuple& NumBins, HTuple* Histo, HTuple* BinSize)

HTuple HImage::GrayHistoRange(const HRegion& Regions, const HTuple& Min, const HTuple& Max, Hlong NumBins, double* BinSize) const

Hlong HImage::GrayHistoRange(const HRegion& Regions, double Min, double Max, Hlong NumBins, double* BinSize) const

HTuple HRegion::GrayHistoRange(const HImage& Image, const HTuple& Min, const HTuple& Max, Hlong NumBins, double* BinSize) const

Hlong HRegion::GrayHistoRange(const HImage& Image, double Min, double Max, Hlong NumBins, double* BinSize) const

static void HOperatorSet.GrayHistoRange(HObject regions, HObject image, HTuple min, HTuple max, HTuple numBins, out HTuple histo, out HTuple binSize)

HTuple HImage.GrayHistoRange(HRegion regions, HTuple min, HTuple max, int numBins, out double binSize)

int HImage.GrayHistoRange(HRegion regions, double min, double max, int numBins, out double binSize)

HTuple HRegion.GrayHistoRange(HImage image, HTuple min, HTuple max, int numBins, out double binSize)

int HRegion.GrayHistoRange(HImage image, double min, double max, int numBins, out double binSize)

Description

gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRangeGrayHistoRange calculates the gray value distribution HistoHistoHistoHistohisto of the single channel ImageImageImageImageimage within RegionsRegionsRegionsRegionsregions and the gray value range [MinMinMinMinmin,MaxMaxMaxMaxmax]. The values for MinMinMinMinmin and MaxMaxMaxMaxmax are rounded down to the next integer if the ImageImageImageImageimage is not of type 'real'"real""real""real""real". The gray value range is divided into NumBinsNumBinsNumBinsNumBinsnumBins bins of the same size, which is returned in BinSizeBinSizeBinSizeBinSizebinSize. If a gray value lies between two bins the gray value is assigned to the smaller bin. If the ImageImageImageImageimage is of type 'real'"real""real""real""real" . If the ImageImageImageImageimage has discrete gray values the size of a bin is computed with . Since the accuracy of the histogram HistoHistoHistoHistohisto can be adjusted with NumBinsNumBinsNumBinsNumBinsnumBins, the calculation of the gray value histogram with gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRangeGrayHistoRange is most useful for images of type 'real'"real""real""real""real" and images of type 'integer'"integer""integer""integer""integer", which have a high bit depth.

Attention

Note that the operator gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRangeGrayHistoRange only considers the given RegionsRegionsRegionsRegionsregions and ignores any previously set domain of the input image ImageImageImageImageimage.

If the ImageImageImageImageimage has discrete gray values the value of BinSizeBinSizeBinSizeBinSizebinSize may cause the following effects: For BinSizeBinSizeBinSizeBinSizebinSize > 1 multiple neighboring gray values are assigned to the same bin. If BinSizeBinSizeBinSizeBinSizebinSize is no integer the gray values are distributed uneven among the bins, e.g., for BinSizeBinSizeBinSizeBinSizebinSize = 1.5 the first and second gray value are assigned to the first bin, the third gray value is assigned to the second bin, and the fourth and fifth gray value are assigned to the third bin. This becomes noticeable in several peeks in the histogram HistoHistoHistoHistohisto. If BinSizeBinSizeBinSizeBinSizebinSize < 1 some classes are not assigned by any gray value, e.g., for BinSizeBinSizeBinSizeBinSizebinSize = 0.5 the first gray value is assigned to the first bin and the second gray value is assigned to the third bin. The histogram HistoHistoHistoHistohisto shows some gaps, which resembles the structure of a comb.

If the ImageImageImageImageimage is of type 'real'"real""real""real""real" and MinMinMinMinmin = MaxMaxMaxMaxmax, all pixels of the corresponding gray value are assigned only to the first bin.

Execution Information

Parameters

RegionsRegionsRegionsRegionsregions (input_object)  region(-array) objectHRegionHRegionHobject

Region in which the histogram is to be calculated.

ImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHobject (byte / cyclic / direction / int1 / uint2 / int2 / int4 / int8 / real)

Input image.

MinMinMinMinmin (input_control)  real HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Minimum gray value.

Default value: 0

Suggested values: 0

MaxMaxMaxMaxmax (input_control)  real HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Maximum gray value.

Default value: 255

Suggested values: 255

Restriction: Max >= Min

NumBinsNumBinsNumBinsNumBinsnumBins (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of bins.

Default value: 256

Suggested values: 16, 32, 64, 128, 256

Restriction: NumBins >= 1

HistoHistoHistoHistohisto (output_control)  histogram(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Histogram to be calculated.

BinSizeBinSizeBinSizeBinSizebinSize (output_control)  real HTupleHTupleHtuple (real) (double) (double) (double)

Bin size.

Result

If the parameters are valid, the operator gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRangeGrayHistoRange returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.

Possible Predecessors

min_max_graymin_max_grayMinMaxGrayMinMaxGrayMinMaxGray

Possible Successors

create_funct_1d_arraycreate_funct_1d_arrayCreateFunct1dArrayCreateFunct1dArrayCreateFunct1dArray

Alternatives

gray_histogray_histoGrayHistoGrayHistoGrayHisto, gray_histo_absgray_histo_absGrayHistoAbsGrayHistoAbsGrayHistoAbs

See also

histo_2dimhisto_2dimHisto2dimHisto2dimHisto2dim, scale_image_maxscale_image_maxScaleImageMaxScaleImageMaxScaleImageMax

Module

Foundation


ClassesClasses | | Operators