Determine a histogram of features along all threshold values.
The operator shape_histo_all carries out 255 threshold operations within Region with the gray values of Image. The entry i in the histogram corresponds to the number of connected components/holes of this image segmented with the threshold i (Feature = 'connected_components', 'holes') or the mean value of the feature values of the regions segmented in this way (Feature = 'convexity', 'compactness', 'ansisometry'), respectively.
The histogram can also be displayed directly as a graphic via the operators set_paint(::WindowHandle,'component_histogram':) and disp_image.
The operator shape_histo_all expects a region and exactly one gray value image as input. Because of the power of this operator the runtime of shape_histo_all is relatively large!
|
Region (input_object) |
region -> object |
| Region in which the features are to be examined. | |
|
Image (input_object) |
image -> object : byte |
| Gray value image. | |
|
Feature (input_control) |
string -> string |
| Feature to be examined. | |
| Default value: 'connected_components' | |
| List of values: 'connected_components', 'convexity', 'compactness', 'anisometry', 'holes' | |
|
AbsoluteHisto (output_control) |
histogram-array -> real / integer |
| Absolute distribution of the feature. | |
|
RelativeHisto (output_control) |
histogram-array -> real |
| Relative distribution of the feature. | |
/* Simulation von shape_histo_all mit Merkmal 'connected_components': */
my_shape_histo_all(Region,Image,AbsHisto,RelHisto):
reduce_domain(Region,Image,RegionGray)
for(0,255,i)
threshold(RegionGray,Seg,i,255)
connect_and_holes(Seg,AbsHisto[i],_)
clear_obj([Seg,H])
end_for()
eval(0,Sum)
for(0,255,i)
eval(Sum+AbsHisto[i],Sum)
end_for()
for(0,255,i)
eval(AbsHisto[i]/Sum,RelHisto[i])
end_for()
If F is the area of the input region and N the mean number of connected components the runtime complexity is O(255 * (F + sqrt(F) * sqrt(N)).
The operator shape_histo_all returns the value 2 (H_MSG_TRUE) if an image with the defined gray values is entered. The behavior in case of empty input (no input images) 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.
shape_histo_all is reentrant and processed without parallelization.
histo_to_thresh, threshold, gen_region_histo
connection, convexity, compactness, connect_and_holes, entropy_gray, gray_histo, set_paint, count_obj
Image filters