gray_histo — 计算灰度值分布。
gray_histo(Regions, Image : : : AbsoluteHisto, RelativeHisto)
算子 gray_histo calculates for the image
(Image) within Regions the absolute
(AbsoluteHisto) and relative (RelativeHisto)
histogram of the gray values.
Both histograms are tuples of 256 values, which --- beginning at 0 --- contain the frequencies of the individual gray values of the image.
AbsoluteHisto indicates the absolute frequencies of the
gray values in integers, and RelativeHisto indicates the
relative, i.e. the absolute frequencies divided by the area of the
image as floating point numbers.
'real'-, 'int2'-, 'uint2'-, and 'int4'-images are transformed into 'byte'-images (first the largest and smallest gray value in the image are determined, and then the original gray values are mapped linearly into the area 0..255) and then processed as mentioned above.
Note that the operator gray_histo only considers
the given Regions and ignores any previously set domain
of the input image Image。
Real, int2, uint2, and int4 images are reduced to 256 gray values.
gray_histo can be executed on OpenCL devices for byte, int1,
directional and cyclic images if the OpenCL device supports the
cl_khr_local_int32_base_atomics and cl_khr_global_int32_base_atomics
extensions (which are optional in OpenCL 1.0). Unlike most other HALCON
operators, gray_histo can be substantially slower on an OpenCL
device if the Image is not completely included in the
Regions。
OpenCL support is not available in HALCON XL, as 64 bit atomic integer arithmetic would be required.
Regions (输入对象) region(-array) → object
Region in which the histogram is to be calculated.
Image (输入对象) singlechannelimage → object (byte* / cyclic* / direction* / int1* / int2 / uint2 / int4 / real) *允许用于计算设备
Image the gray value distribution of which is to be calculated.
AbsoluteHisto (输出控制) histogram-array → (integer)
Absolute frequencies of the gray values.
RelativeHisto (输出控制) histogram-array → (real)
Frequencies, normalized to the area of the region.
If F is the area of the region the runtime complexity is O(F + 255).
算子 gray_histo 返回值 2 (
H_MSG_TRUE)
if the image
has defined gray values and the parameters are correct.当输入为空(无可用输入图像)时可设置行为通过算子 set_system(::'no_object_result',<Result>:), the behavior
in case of empty region is set via
set_system(::'empty_region_result',<Result>:)。如有必要,则抛出异常。
histo_to_thresh,
gen_region_histo
min_max_gray,
intensity,
gray_histo_abs,
gray_histo_range
set_paint,
histo_2dim,
scale_image_max,
entropy_gray
基础