Calculate the gray value distribution.
The operator ::gray_histo calculates for the image (Image) within Regions the absolute (AbsoluteHisto) and relative (RelativeHisto) histogram of the gray values.
Both histograms are tupels 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- 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. The histogram can also be returned directly as a graphic via the operators ::set_paint(WindowHandle,'histogram') and ::disp_image.
Real, int2 and int4 images are reduced to 256 gray values.
|
Regions (input_object) |
region(-array) -> Hobject: HRegion(Array) |
| Region in which the histogram is to be calculated. | |
|
Image (input_object) |
image -> Hobject: HImage ( byte / cyclic / direction / int1 / int2 / int4 / real ) |
| Image the gray value distribution of which is to be calculated. | |
|
AbsoluteHisto (output_control) |
histogram-array -> HTuple.long * |
| Absolute frequencies of the gray values. | |
|
RelativeHisto (output_control) |
histogram-array -> HTuple.double * |
| Frequencies, normalized to the area of the region. | |
If F is the area of the region the runtime complexity is O(F + 255).
The operator ::gray_histo returns the value H_MSG_TRUE if the image has 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 behavior in case of empty region is set via ::set_system('empty_region_result',<Result>). If necessary an exception handling is raised.
::histo_to_thresh, ::gen_region_histo
::set_paint, ::disp_image, ::histo_2dim, ::scale_image_max, ::entropy_gray
Image filters