Skip to content

set_fuzzy_measure_norm_pairset_fuzzy_measure_norm_pairSetFuzzyMeasureNormPairSetFuzzyMeasureNormPairset_fuzzy_measure_norm_pairT_set_fuzzy_measure_norm_pairπŸ”—

Short descriptionπŸ”—

set_fuzzy_measure_norm_pairset_fuzzy_measure_norm_pairSetFuzzyMeasureNormPairSetFuzzyMeasureNormPairset_fuzzy_measure_norm_pairT_set_fuzzy_measure_norm_pair β€” Specify a normalized fuzzy function for edge pairs.

SignatureπŸ”—

set_fuzzy_measure_norm_pair( measure MeasureHandle, number PairSize, string SetType, function_1d Function )set_fuzzy_measure_norm_pair( : : MeasureHandle, PairSize, SetType, Function : )void SetFuzzyMeasureNormPair( const HTuple& MeasureHandle, const HTuple& PairSize, const HTuple& SetType, const HTuple& Function )static void HOperatorSet.SetFuzzyMeasureNormPair( HTuple measureHandle, HTuple pairSize, HTuple setType, HTuple function )def set_fuzzy_measure_norm_pair( measure_handle: HHandle, pair_size: Union[float, int], set_type: str, function: Sequence[Union[float, int]] ) -> None

Herror T_set_fuzzy_measure_norm_pair( const Htuple MeasureHandle, const Htuple PairSize, const Htuple SetType, const Htuple Function )

void HMeasure::SetFuzzyMeasureNormPair( const HTuple& PairSize, const HString& SetType, const HFunction1D& Function ) const

void HMeasure::SetFuzzyMeasureNormPair( double PairSize, const HString& SetType, const HFunction1D& Function ) const

void HMeasure::SetFuzzyMeasureNormPair( double PairSize, const char* SetType, const HFunction1D& Function ) const

void HMeasure::SetFuzzyMeasureNormPair( double PairSize, const wchar_t* SetType, const HFunction1D& Function ) const (Windows only)

void HMeasure.SetFuzzyMeasureNormPair( HTuple pairSize, string setType, HFunction1D function )

void HMeasure.SetFuzzyMeasureNormPair( double pairSize, string setType, HFunction1D function )

DescriptionπŸ”—

set_fuzzy_measure_norm_pairSetFuzzyMeasureNormPair specifies a normalized fuzzy function passed in Functionfunctionfunction. The specified fuzzy functions enables fuzzy_measure_posFuzzyMeasurePos, fuzzy_measure_pairsFuzzyMeasurePairs and fuzzy_measure_pairingFuzzyMeasurePairing 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_measureSetFuzzyMeasure, the abscissa \(x\) of these functions must be defined relative to the desired size \(s\) of the edge pairs (passed in PairSizepairSizepair_size). This enables a generalized usage of the defined functions. A previously defined normalized fuzzy function can be discarded completely by reset_fuzzy_measureResetFuzzyMeasure.

For an explanation of the concept of 1D measuring see the introduction of chapter 1D Measuring.

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

  • 'size'"size" denotes a fuzzy set that valuates the normalized distance of two edges of a pair in pixels:

    \[\begin{eqnarray*} x = \frac{d}{s} ( x \ge 0 ) \enspace . \end{eqnarray*}\]

    .

    Specifying an upper bound \(x_{max}\) for the size by terminating the function with a corresponding fuzzy value of 0.0 will speed up fuzzy_measure_pairsFuzzyMeasurePairs / fuzzy_measure_pairingFuzzyMeasurePairing because not all possible pairs must be considered. Additionally, this fuzzy set can also be specified as a normalized size difference by 'size_diff'"size_diff"

    \[\begin{eqnarray*} x = \frac{s-d}{s} ( x \le 1 ) \end{eqnarray*}\]

    and a absolute normalized size difference by 'size_abs_diff'"size_abs_diff"

    \[\begin{eqnarray*} x = \frac{|s-d|}{s} ( 0 \le x \le 1 ) \enspace . \end{eqnarray*}\]

    .

  • The fuzzy function of 'position'"position" evaluates the signed distance \(p\) of each edge candidate to the reference point of the measure object, generated by gen_measure_arcGenMeasureArc or gen_measure_rectangle2GenMeasureRectangle2:

    \[\begin{eqnarray*} x = \frac{p}{s} \enspace . \end{eqnarray*}\]

    .

    The reference point is located at the beginning whereas 'position_center'"position_center" or 'position_end'"position_end" sets the reference point to the middle or the end of the one-dimensional gray value profile, instead. If the fuzzy position valuation depends on the position of the object along the profile 'position_first_edge'"position_first_edge" / 'position_last_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 edges.

  • Similar to 'position'"position", 'position_pair'"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_center", 'position_pair_end'"position_pair_end" and 'position_first_pair'"position_first_pair", 'position_last_pair'"position_last_pair", respectively. Contrary to 'position'"position", this set is only used by fuzzy_measure_pairsFuzzyMeasurePairs/fuzzy_measure_pairingFuzzyMeasurePairing.

A normalized fuzzy 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 functions can be generated by create_funct_1d_pairsCreateFunct1dPairs.

If more than one set is defined, fuzzy_measure_posFuzzyMeasurePos / fuzzy_measure_pairsFuzzyMeasurePairs / fuzzy_measure_pairingFuzzyMeasurePairing yield the overall fuzzy weighting by the geometric mean of the weights of each set.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

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.

ParametersπŸ”—

MeasureHandlemeasureHandlemeasure_handle (input_control, state is modified) measure β†’ (handle)(handle)HTuple (HHandle)HMeasure, HTuple (IntPtr)HHandleHtuple (handle)

Measure object handle.

PairSizepairSizepair_size (input_control) number β†’ (real / integer)(real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Favored width of edge pairs.

Default: 10.010.0
Suggested values: 4.0, 6.0, 8.0, 10.0, 15.0, 20.0, 30.04.0, 6.0, 8.0, 10.0, 15.0, 20.0, 30.0
Value range: 0.0 ≀ PairSize
Minimum increment: 0.1
Recommended increment: 1.0

SetTypesetTypeset_type (input_control) string β†’ (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Selection of the fuzzy set.

Default: 'size_abs_diff'"size_abs_diff"
List of values: 'position', 'position_center', 'position_end', 'position_first_edge', 'position_first_pair', 'position_last_edge', 'position_last_pair', 'position_pair_center', 'position_pair_end', 'size', 'size_abs_diff', 'size_diff'"position", "position_center", "position_end", "position_first_edge", "position_first_pair", "position_last_edge", "position_last_pair", "position_pair_center", "position_pair_end", "size", "size_abs_diff", "size_diff"

Functionfunctionfunction (input_control) function_1d β†’ (real / integer)(real / integer)HTuple (double / Hlong)HFunction1D, HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Fuzzy function.

ExampleπŸ”—

(HDevelop)


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

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

gen_measure_arcGenMeasureArc, gen_measure_rectangle2GenMeasureRectangle2, create_funct_1d_pairsCreateFunct1dPairs

Possible successors

fuzzy_measure_pairsFuzzyMeasurePairs, fuzzy_measure_pairingFuzzyMeasurePairing

Alternatives

transform_funct_1dTransformFunct1d, set_fuzzy_measureSetFuzzyMeasure

See also

reset_fuzzy_measureResetFuzzyMeasure

ModuleπŸ”—

1D Metrology