Name
min_max_graymin_max_grayMinMaxGraymin_max_grayMinMaxGrayMinMaxGray — Determine the minimum and maximum gray values within regions.
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)
Herror min_max_gray(Hobject Regions, Hobject Image, const HTuple& Percent, double* Min, double* Max, double* Range)
Herror min_max_gray(Hobject Regions, Hobject Image, const HTuple& Percent, HTuple* Min, HTuple* Max, HTuple* Range)
double HRegion::MinMaxGray(const HImage& Image, const HTuple& Percent, double* Max, double* Range) const
HTuple HRegionArray::MinMaxGray(const HImage& Image, const HTuple& Percent, HTuple* Max, HTuple* Range) const
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
void HOperatorSetX.MinMaxGray(
[in] IHUntypedObjectX* Regions, [in] IHUntypedObjectX* Image, [in] VARIANT Percent, [out] VARIANT* Min, [out] VARIANT* Max, [out] VARIANT* Range)
VARIANT HImageX.MinMaxGray(
[in] IHRegionX* Regions, [in] VARIANT Percent, [out] VARIANT* Max, [out] VARIANT* Range)
VARIANT HRegionX.MinMaxGray(
[in] IHImageX* Image, [in] VARIANT Percent, [out] VARIANT* Max, [out] VARIANT* Range)
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)
The operator min_max_graymin_max_grayMinMaxGraymin_max_grayMinMaxGrayMinMaxGray creates the histogram of the
absolute frequencies of the gray values within RegionsRegionsRegionsRegionsRegionsregions in
the input image ImageImageImageImageImageimage (see gray_histogray_histoGrayHistogray_histoGrayHistoGrayHisto) 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:
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 = 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_grayMinMaxGraymin_max_grayMinMaxGrayMinMaxGray only considers
the given RegionsRegionsRegionsRegionsRegionsregions and ignores any previously set domain
of the input image ImageImageImageImageImageimage.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
Regions, the features of which are to be calculated.
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
“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)
/* 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);
* 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)
#include "HalconCpp.h"
using namespace Halcon;
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
main()
{
HImage img ("fabrik");
HWindow w;
Htuple range, max;
img.Display (w);
w.Click ();
HRegion reg = w.DrawRegion ();
HImage rdd = img.ReduceDomain (reg);
Htuple min = reg.MinMaxGray (rdd, 5, &max, &range);
HRegionArray imgseg = ((img >= min[0].I()).Connection() &
(img <= max[0].I()).Connection());
cout << "Min = " << min[0].I() << endl;
cout << "Max = " << max[0].I() << endl;
imgseg.Display (w);
w.Click ();
return(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)
* 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_graymin_max_grayMinMaxGraymin_max_grayMinMaxGrayMinMaxGray 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>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>).
The behaviour 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>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>).
If necessary an exception is raised.
draw_regiondraw_regionDrawRegiondraw_regionDrawRegionDrawRegion,
gen_circlegen_circleGenCirclegen_circleGenCircleGenCircle,
gen_ellipsegen_ellipseGenEllipsegen_ellipseGenEllipseGenEllipse,
gen_rectangle1gen_rectangle1GenRectangle1gen_rectangle1GenRectangle1GenRectangle1,
thresholdthresholdThresholdthresholdThresholdThreshold,
regiongrowingregiongrowingRegiongrowingregiongrowingRegiongrowingRegiongrowing
thresholdthresholdThresholdthresholdThresholdThreshold
select_grayselect_graySelectGrayselect_graySelectGraySelectGray,
intensityintensityIntensityintensityIntensityIntensity
gray_histogray_histoGrayHistogray_histoGrayHistoGrayHisto,
scale_imagescale_imageScaleImagescale_imageScaleImageScaleImage,
scale_image_maxscale_image_maxScaleImageMaxscale_image_maxScaleImageMaxScaleImageMax,
learn_ndim_normlearn_ndim_normLearnNdimNormlearn_ndim_normLearnNdimNormLearnNdimNorm
Foundation