set_fuzzy_measure — Specify a fuzzy function.
set_fuzzy_measure specifies a fuzzy function passed
Function. The specified fuzzy functions enable
fuzzy_measure_pairing to evaluate and select the detected
edge candidates. For this purpose, weighting characteristics for
different edge features can be defined by one function each. Such a
specified feature is called fuzzy set. Specifying no function for a fuzzy
set means not to use this feature for the final edge evaluation. Setting
a second fuzzy function to a set means to discard the first defined
function and replace it by the second one. A previously defined fuzzy
function can be discarded completely by
For an explanation of the concept of 1D measuring see the introduction of chapter 1D Measuring.
Functions for five different fuzzy set types selected by the
SetType parameter can be defined, the sub types of a set being
'contrast' will use the fuzzy function to evaluate the amplitudes of the edge candidates. When extracting edge pairs, the fuzzy evaluation is obtained by the geometric average of the fuzzy contrast scores of both edges.
The fuzzy function of 'position' evaluates the distance
of each edge candidate to the reference point of the
measure object, generated by
gen_measure_rectangle2. The reference point is
located at the beginning whereas 'position_center' or
'position_end' sets the reference point to the middle or
the end of the one-dimensional gray value profile instead.
If the fuzzy position evaluation depends on the position
of the object along the profile, 'position_first_edge' /
'position_last_edge' sets the reference point at the
position of the first/last extracted edge. When extracting
edge pairs the position of a pair is referenced by the
geometric average of the fuzzy position scores of both
Similar to 'position', 'position_pair' evaluates the
distance of each edge pair to the reference point of the measure
object. The position of a pair is defined by the center point between
both edges. The object's reference can be set by
'position_pair_center', 'position_pair_end' and
respectively. Contrary to 'position', this set is only used by
'size' denotes a fuzzy set that evaluates the normed
the two edges of a pair in pixels. This set is only used by
fuzzy_measure_pairing. Specifying an
upper bound for the size by terminating the function
with a corresponding fuzzy value of 0.0 will speed up
not all possible pairs need to be considered.
A fuzzy function is defined as a piecewise linear function by
two pairs of values, sorted in an ascending order by their x
value. The x values represent the edge feature and must lie
within the parameter space of the set type, i.e., in case of
'contrast' and 'gray' feature and, e.g., byte images
within the range 0.0 <= x <= 255.0. In case of
'size' x has
to satisfy 0.0 <= x whereas in case of 'position'
x can be
any real number. The y values of the fuzzy function represent the
weight of the corresponding feature value and have to satisfy the
range of 0.0 <= y <= 1.0. Outside of the
defined by the smallest and the greatest x value, the y values of
the interval borders are continued constantly. Such Fuzzy
functions can be generated by
If more than one set is defined,
the overall fuzzy weighting by the geometric middle of the weights
of each set.
This operator modifies the state of the following input parameter:
During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.
MeasureHandle(input_control, state is modified) measure
Measure object handle.
Selection of the fuzzy set.
Default value: 'contrast'
List of values: 'contrast', 'gray', 'position', 'position_center', 'position_end', 'position_first_edge', 'position_first_pair', 'position_last_edge', 'position_last_pair', 'position_pair_center', 'position_pair_end', 'size'
→(real / integer)
* how to use a fuzzy function * ... gen_measure_rectangle2 (50, 100, 0, 200, 100, 512, 512, 'nearest_neighbor', \ MeasureHandle) * create a generalized fuzzy function to evaluate edge pairs * * (30% uncertainty). create_funct_1d_pairs ([0.7,1.0,1.3], [0.0,1.0,0.0], SizeFunction) * and transform it to expected size of 13.45 pixels transform_funct_1d (SizeFunction, [1.0,0.0,13.45,0.0], TransformedFunction) set_fuzzy_measure (MeasureHandle, 'size', TransformedFunction) fuzzy_measure_pairs (Image, MeasureHandle, 1, 30, 0.5, 'all', RowEdgeFirst, \ ColumnEdgeFirst, AmplitudeFirst, RowEdgeSecond, \ ColumnEdgeSecond, AmplitudeSecond, RowEdgeCenter, \ ColumnEdgeCenter, FuzzyScore, IntraDistance, \ InterDistance)