tshape_histo1 ( Region, Image : : Feature : AbsoluteHisto, RelativeHisto )

Determine a histogram of features along all threshold values.

The operator tshape_histo1 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(::'component_histogram':) and disp_image.


Attention

The operator tshape_histo1 expects a region and exactly one gray value image as input. Because of the power of this operator the runtime of tshape_histo1 is relatively large!


Parameters

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.values-array -> real / integer
Absolute distribution of the feature.

RelativeHisto (output_control)
histogram.values-array -> real
Relative distribution of the feature.


Example
/* Simulation von tshape_histo1 mit Merkmal 'connected_components': */
my_tshape_histo1(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([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(:::)
  

Complexity

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)).


Result

The operator tshape_histo1 returns the value 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 is raised.


Possible Successors

histo_to_thresh, threshold__, histo_to_region


Alternatives

tshape_histo2


See also

connection, convexity, compactness, connect_and_holes, entropy2__, histo__, set_paint, count_obj



Copyright © 1996-1997 MVTec Software GmbH