set_fuzzy_measure_norm_pair ( : : MeasureHandle, PairSize, SetType, Function : )

Specify a normalized fuzzy member function for edge pairs.

set_fuzzy_measure_norm_pair specifies a normalized fuzzy member function passed in Function. The specified fuzzy functions enables fuzzy_measure_pos, fuzzy_measure_pairs and fuzzy_measure_pairing to evaluate and select the detected candidates of edges and edge pairs. 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 fuzzy set means to discard the first defined function and replace it by the second one. In difference to set_fuzzy_measure, the abscissa x of these member functions must be defined relative to the desired size s of the edge pairs (passed in PairSize). This enables a generalized usage of the defined functions. A previously defined normalized fuzzy member function can be discarded completely by reset_fuzzy_measure.

Functions for three different fuzzy set types selected by the SetType parameter can be defined, the sub types of a set beeing mutual exclusive:

  - 'size' denotes a fuzzy set that valuates the normed
    distance of two edges of a pair in pixels:
        x = d/s  ( x >= 0 ).
    Specifying an upper bound x_max for the size by terminating the
    member function with a corresponding fuzzy value of 0.0 will
    speed up fuzzy_measure_pairs / fuzzy_measure_pairing because
    not all possible pairs need to be considered. Additionally, this 
    fuzzy set can also be specified as a size difference 
    by 'size_diff'
        x = (s-d)/s  ( x <= 1 )
    and a absolute normed size difference by 'size_abs_diff'
        x = |s-d|/s  ( 0 <= x <= 1 ). 
    This set is only used by fuzzy_measure_pairs/fuzzy_measure_pairing.

  - The fuzzy function of 'position' evaluates the signed distance p
    of each edge candidate to the reference point of the measure object,
    generated by gen_measure_arc or gen_measure_rectangle2:
        x = p/s.
    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 referece point at the position of
    the first/last extracted edge. When extracting edge pairs, the
    position of a pair is referenced by the geometric mean of the
    fuzzy position scores of both edges. 

  - Similar to 'position', 'position_pair' evaluates the
    signed 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 'position_first_pair',
    'position_last_pair', respectively.  Contrary to 'position', this set 
    is only used by fuzzy_measure_pairs/fuzzy_measure_pairing.
A normalized fuzzy member function is defined as a piecewise linear function by at least two pairs of values, sorted in an ascending order by their x value. The y values of the fuzzy function represent the weight of the corresponding feature value and must satisfy the range of 0.0 <= y <= 1.0. Outside of the function's interval, defined by the smallest and the greatest x value, the y values of the interval borders are continued constantly. Such Fuzzy member functions can be generated by create_funct_1d_pairs.

If more than one set is defined, fuzzy_measure_pos / fuzzy_measure_pairs / fuzzy_measure_pairing yield the overall fuzzy weighting by the geometric mean of the weights of each set.


Parameters

MeasureHandle (input_control)
measure_id -> integer
Measure object handle.

PairSize (input_control)
number -> real / integer
Favored width of edge pairs.
Default value: 10.0
List of values: 4.0, 6.0, 8.0, 10.0, 15.0, 20.0, 30.0
Typical range of values: 0.0 <= PairSize
Minimum increment: 0.1
Recommended increment: 1.0

SetType (input_control)
string -> string
Selection of the fuzzy set.
Default value: 'size_abs_diff'
List of values: 'size', 'size_diff', 'size_abs_diff', 'position', 'position_center', 'position_end', 'position_first_edge', 'position_last_edge', 'position_pair_center', 'position_pair_end', 'position_first_pair', 'position_last_pair'

Function (input_control)
function_1d-array -> real / integer
Fuzzy member function.


Example
/* 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 set it for an expected pair size of 13.45 pixels */ 
set_fuzzy_measure_norm_pair (MeasureHandle, 13.45, 'size', SizeFunction)

fuzzy_measure_pairs (Image, MeasureHandle, 1, 30, 0.5, 'all', RowEdgeFirst,
                     ColumnEdgeFirst, AmplitudeFirst, RowEdgeSecond, 
                     ColumnEdgeSecond, AmplitudeSecond, RowEdgeCenter,
                     ColumnEdgeCenter, FuzzyScore, IntraDistance, 
                     InterDistance)

Parallelization Information

set_fuzzy_measure_norm_pair is reentrant and processed without parallelization.


Possible Predecessors

gen_measure_arc, gen_measure_rectangle2, create_funct_1d_pairs


Possible Successors

fuzzy_measure_pairs, fuzzy_measure_pairing


Alternatives

transform_funct_1d, set_fuzzy_measure


See also

reset_fuzzy_measure


Module

1D Metrology



Copyright © 1996-2008 MVTec Software GmbH