min_max_gray — Determine the minimum and maximum gray values within regions.
The operator min_max_gray creates the histogram of the absolute frequencies of the gray values within Regions in the input image Image (see gray_histo) and calculates the number of pixels Percent 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:
e.g.: Area = 60, percent = 5, i.e. 3 pixels Histogram = [2,8,0,7,13,0,0,...,0,10,10,5,3,1,1] => Maximum = 255, Minimum = 0, Range = 255 min_max_gray returns: Maximum = 253, Minimum = 1, Range = 252For images of type int4, int8, and real, the above calculation is not performed via histograms, but using a rank selection algorithm. If Percent is set to 50, Min = Max = Median. If Percent is 0 no histogram is calculated in order to enhance the runtime.
Note that the operator min_max_gray only considers the given Regions and ignores any previously set domain of the input image Image.
Regions, the features of which are to be calculated.
Gray value image.
Percentage below (above) the absolute maximum (minimum).
Default value: 0
Suggested values: 0, 1, 2, 5, 7, 10, 15, 20, 30, 40, 50
Restriction: 0 <= Percent && Percent <= 50
“Minimum” gray value.
“Maximum” gray value.
Assertion: Max >= Min
Difference between Max and Min.
Assertion: Range >= 0
* 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)
The operator min_max_gray returns the value 2 (H_MSG_TRUE) if the input image has the 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 behaviour in case of an empty region is set via the operator set_system(::'empty_region_result',<Result>:). If necessary an exception is raised.
draw_region, gen_circle, gen_ellipse, gen_rectangle1, threshold, regiongrowing
gray_histo, scale_image, scale_image_max, learn_ndim_norm