min_max_graymin_max_grayMinMaxGrayMinMaxGraymin_max_gray (算子)

名称

min_max_graymin_max_grayMinMaxGrayMinMaxGraymin_max_gray — 确定区域内的最小和最大灰度值。

签名

min_max_gray(Regions, Image : : Percent : Min, Max, Range)

Herror min_max_gray(const Hobject Regions, const Hobject Image, double Percent, double* Min, double* Max, double* Range)

Herror T_min_max_gray(const Hobject Regions, const Hobject Image, const Htuple Percent, Htuple* Min, Htuple* Max, Htuple* Range)

void MinMaxGray(const HObject& Regions, const HObject& Image, const HTuple& Percent, HTuple* Min, HTuple* Max, HTuple* Range)

void HImage::MinMaxGray(const HRegion& Regions, const HTuple& Percent, HTuple* Min, HTuple* Max, HTuple* Range) const

void HImage::MinMaxGray(const HRegion& Regions, double Percent, double* Min, double* Max, double* Range) const

void HRegion::MinMaxGray(const HImage& Image, const HTuple& Percent, HTuple* Min, HTuple* Max, HTuple* Range) const

void HRegion::MinMaxGray(const HImage& Image, double Percent, double* Min, double* Max, double* Range) const

static void HOperatorSet.MinMaxGray(HObject regions, HObject image, HTuple percent, out HTuple min, out HTuple max, out HTuple range)

void HImage.MinMaxGray(HRegion regions, HTuple percent, out HTuple min, out HTuple max, out HTuple range)

void HImage.MinMaxGray(HRegion regions, double percent, out double min, out double max, out double range)

void HRegion.MinMaxGray(HImage image, HTuple percent, out HTuple min, out HTuple max, out HTuple range)

void HRegion.MinMaxGray(HImage image, double percent, out double min, out double max, out double range)

def min_max_gray(regions: HObject, image: HObject, percent: Union[int, float]) -> Tuple[Sequence[float], Sequence[float], Sequence[float]]

def min_max_gray_s(regions: HObject, image: HObject, percent: Union[int, float]) -> Tuple[float, float, float]

描述

算子 min_max_graymin_max_grayMinMaxGrayMinMaxGrayMinMaxGraymin_max_gray creates the histogram of the absolute frequencies of the gray values within RegionsRegionsRegionsRegionsregionsregions in the input image ImageImageImageImageimageimage (see gray_histogray_histoGrayHistoGrayHistoGrayHistogray_histo) and calculates the number of pixels PercentPercentPercentPercentpercentpercent corresponding to the area of the input image. Then it goes inwards on both sides of the histogram by this number of pixels and determines the smallest and the largest gray value:

示例:

With area = 60, PercentPercentPercentPercentpercentpercent = 5, d.h. i.e. 3 pixels, histogram = [2,8,0,7,13,0,0,...,0,10,10,5,3,1,1],

Minimum = 0, Maximum = 255, range = 255

min_max_graymin_max_grayMinMaxGrayMinMaxGrayMinMaxGraymin_max_gray returns: MinMinMinMinminmin = 1, MaxMaxMaxMaxmaxmax = 253, RangeRangeRangeRangerangerange = 252.

For images of type int4, int8, and real, the above calculation is not performed via histograms, but using a rank selection algorithm. If PercentPercentPercentPercentpercentpercent is set to 50, MinMinMinMinminmin = MaxMaxMaxMaxmaxmax = Median. If PercentPercentPercentPercentpercentpercent is 0 no histogram is calculated in order to enhance the runtime.

注意

Note that the operator min_max_graymin_max_grayMinMaxGrayMinMaxGrayMinMaxGraymin_max_gray only considers the given RegionsRegionsRegionsRegionsregionsregions and ignores any previously set domain of the input image ImageImageImageImageimageimage

执行信息

参数

RegionsRegionsRegionsRegionsregionsregions (输入对象)  region(-array) objectHRegionHObjectHRegionHobject

Regions, the features of which are to be calculated.

ImageImageImageImageimageimage (输入对象)  singlechannelimage objectHImageHObjectHImageHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real)

灰度值图像。

PercentPercentPercentPercentpercentpercent (输入控制)  number HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Percentage below (above) the absolute maximum (minimum).

默认值: 0

建议值: 0, 1, 2, 5, 7, 10, 15, 20, 30, 40, 50

限制: 0 <= Percent && Percent <= 50

MinMinMinMinminmin (输出控制)  real(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

“Minimum” gray value.

MaxMaxMaxMaxmaxmax (输出控制)  real(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

“Maximum” gray value.

Assertion: Max >= Min

RangeRangeRangeRangerangerange (输出控制)  real(-array) HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Difference between Max and Min.

Assertion: Range >= 0

示例(HDevelop)

* Threshold segmentation with training region:
read_image(Image,'fabrik')
draw_region(Region,WindowHandle)
min_max_gray(Region,Image,5,Min,Max,Range)
threshold(Image,SegmentedRegion,Min,Max)
dev_display(SegmentedRegion)

示例(C)

/* Threshold segmentation with training region: */
read_image(&Image,"fabrik");
draw_region(&Region,WindowHandle);
min_max_gray(Region,Image,5.0,&Min,&Max,NULL);
threshold(Image,&SegmentedRegion,Min,Max);
disp_region(SegmentedRegion,WindowHandle);

示例(HDevelop)

* Threshold segmentation with training region:
read_image(Image,'fabrik')
draw_region(Region,WindowHandle)
min_max_gray(Region,Image,5,Min,Max,Range)
threshold(Image,SegmentedRegion,Min,Max)
dev_display(SegmentedRegion)

示例(HDevelop)

* Threshold segmentation with training region:
read_image(Image,'fabrik')
draw_region(Region,WindowHandle)
min_max_gray(Region,Image,5,Min,Max,Range)
threshold(Image,SegmentedRegion,Min,Max)
dev_display(SegmentedRegion)

示例(HDevelop)

* Threshold segmentation with training region:
read_image(Image,'fabrik')
draw_region(Region,WindowHandle)
min_max_gray(Region,Image,5,Min,Max,Range)
threshold(Image,SegmentedRegion,Min,Max)
dev_display(SegmentedRegion)

结果

算子 min_max_graymin_max_grayMinMaxGrayMinMaxGrayMinMaxGraymin_max_gray 返回值 2 ( H_MSG_TRUE) if the input image has the defined gray values and the parameters are correct.当输入为空(无可用输入图像)时可设置行为通过算子 set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。The behavior in case of an empty region is set via the operator set_system(::'empty_region_result',<Result>:)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>)。如有必要,则抛出异常。

可能的前趋

draw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_region, gen_circlegen_circleGenCircleGenCircleGenCirclegen_circle, gen_ellipsegen_ellipseGenEllipseGenEllipseGenEllipsegen_ellipse, gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1gen_rectangle1, thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing

可能的后继

thresholdthresholdThresholdThresholdThresholdthreshold

替代

select_grayselect_graySelectGraySelectGraySelectGrayselect_gray, intensityintensityIntensityIntensityIntensityintensity

另见

gray_histogray_histoGrayHistoGrayHistoGrayHistogray_histo, scale_imagescale_imageScaleImageScaleImageScaleImagescale_image, scale_image_maxscale_image_maxScaleImageMaxScaleImageMaxScaleImageMaxscale_image_max, learn_ndim_normlearn_ndim_normLearnNdimNormLearnNdimNormLearnNdimNormlearn_ndim_norm

模块

基础