gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRangegray_histo_range (算子)
名称
gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRangegray_histo_range — 计算单通道图像在一定灰度值范围内的灰度值分布。
签名
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)
def gray_histo_range(regions: HObject, image: HObject, min: Union[float, int], max: Union[float, int], num_bins: int) -> Tuple[Sequence[int], float]
def gray_histo_range_s(regions: HObject, image: HObject, min: Union[float, int], max: Union[float, int], num_bins: int) -> Tuple[int, float]
描述
gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRangeGrayHistoRangegray_histo_range calculates the gray value distribution
HistoHistoHistoHistohistohisto of the single channel ImageImageImageImageimageimage within RegionsRegionsRegionsRegionsregionsregions
and the gray value range [MinMinMinMinminmin,MaxMaxMaxMaxmaxmax]. The values for
MinMinMinMinminmin and MaxMaxMaxMaxmaxmax are rounded down to the next integer if the
ImageImageImageImageimageimage is not of type 'real'"real""real""real""real""real". The gray value range is divided
into NumBinsNumBinsNumBinsNumBinsnumBinsnum_bins bins of the same size, which is returned in
BinSizeBinSizeBinSizeBinSizebinSizebin_size. If a gray value lies between two bins the gray value is
assigned to the smaller bin. If the ImageImageImageImageimageimage is of type 'real'"real""real""real""real""real"
.
If the ImageImageImageImageimageimage has discrete gray values the size of a bin is
computed with
. Since the accuracy of the histogram HistoHistoHistoHistohistohisto can
be adjusted with NumBinsNumBinsNumBinsNumBinsnumBinsnum_bins, the calculation of the gray value
histogram with gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRangeGrayHistoRangegray_histo_range is most useful for images of type
'real'"real""real""real""real""real" and images of type 'integer'"integer""integer""integer""integer""integer", which have
a high bit depth.
注意
Note that the operator gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRangeGrayHistoRangegray_histo_range only considers
the given RegionsRegionsRegionsRegionsregionsregions and ignores any previously set domain
of the input image ImageImageImageImageimageimage。
If the ImageImageImageImageimageimage has discrete gray values the value of BinSizeBinSizeBinSizeBinSizebinSizebin_size
may cause the following effects:
For BinSizeBinSizeBinSizeBinSizebinSizebin_size > 1 multiple neighboring gray values are
assigned to the same bin. If BinSizeBinSizeBinSizeBinSizebinSizebin_size is no integer the gray values
are distributed uneven among the bins, e.g., for
BinSizeBinSizeBinSizeBinSizebinSizebin_size = 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 HistoHistoHistoHistohistohisto.
If BinSizeBinSizeBinSizeBinSizebinSizebin_size < 1 some classes are not assigned by any
gray value, e.g., for BinSizeBinSizeBinSizeBinSizebinSizebin_size = 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 HistoHistoHistoHistohistohisto shows some gaps, which
resembles the structure of a comb.
If the ImageImageImageImageimageimage is of type 'real'"real""real""real""real""real" and
MinMinMinMinminmin = MaxMaxMaxMaxmaxmax, all pixels of the corresponding gray value
are assigned only to the first bin.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 在内部数据级别上自动并行化。
参数
RegionsRegionsRegionsRegionsregionsregions (输入对象) region(-array) → objectHRegionHObjectHRegionHobject
Region in which the histogram is to be calculated.
ImageImageImageImageimageimage (输入对象) singlechannelimage → objectHImageHObjectHImageHobject (byte / cyclic / direction / int1 / uint2 / int2 / int4 / int8 / real)
输入图像。
MinMinMinMinminmin (输入控制) real → HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Minimum gray value.
默认值:
0
建议值:
0
MaxMaxMaxMaxmaxmax (输入控制) real → HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Maximum gray value.
默认值:
255
建议值:
255
限制:
Max >= Min
NumBinsNumBinsNumBinsNumBinsnumBinsnum_bins (输入控制) integer → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Number of bins.
默认值:
256
建议值:
16, 32, 64, 128, 256
限制:
NumBins >= 1
HistoHistoHistoHistohistohisto (输出控制) histogram(-array) → HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Histogram to be calculated.
BinSizeBinSizeBinSizeBinSizebinSizebin_size (输出控制) real → HTuplefloatHTupleHtuple (real) (double) (double) (double)
Bin size.
结果
如果参数有效,算子 gray_histo_rangegray_histo_rangeGrayHistoRangeGrayHistoRangeGrayHistoRangegray_histo_range 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。
可能的前趋
min_max_graymin_max_grayMinMaxGrayMinMaxGrayMinMaxGraymin_max_gray
可能的后继
create_funct_1d_arraycreate_funct_1d_arrayCreateFunct1dArrayCreateFunct1dArrayCreateFunct1dArraycreate_funct_1d_array
替代
gray_histogray_histoGrayHistoGrayHistoGrayHistogray_histo,
gray_histo_absgray_histo_absGrayHistoAbsGrayHistoAbsGrayHistoAbsgray_histo_abs
另见
histo_2dimhisto_2dimHisto2dimHisto2dimHisto2dimhisto_2dim,
scale_image_maxscale_image_maxScaleImageMaxScaleImageMaxScaleImageMaxscale_image_max
模块
基础