set_fuzzy_measureT_set_fuzzy_measureSetFuzzyMeasureSetFuzzyMeasure (Operator)

Name

set_fuzzy_measureT_set_fuzzy_measureSetFuzzyMeasureSetFuzzyMeasure — Specify a fuzzy function.

Signature

set_fuzzy_measure( : : MeasureHandle, SetType, Function : )

Herror T_set_fuzzy_measure(const Htuple MeasureHandle, const Htuple SetType, const Htuple Function)

void SetFuzzyMeasure(const HTuple& MeasureHandle, const HTuple& SetType, const HTuple& Function)

void HMeasure::SetFuzzyMeasure(const HString& SetType, const HFunction1D& Function) const

void HMeasure::SetFuzzyMeasure(const char* SetType, const HFunction1D& Function) const

void HMeasure::SetFuzzyMeasure(const wchar_t* SetType, const HFunction1D& Function) const   (Windows only)

static void HOperatorSet.SetFuzzyMeasure(HTuple measureHandle, HTuple setType, HTuple function)

void HMeasure.SetFuzzyMeasure(string setType, HFunction1D function)

Description

set_fuzzy_measureset_fuzzy_measureSetFuzzyMeasureSetFuzzyMeasureSetFuzzyMeasure specifies a fuzzy function passed in FunctionFunctionFunctionFunctionfunction. The specified fuzzy functions enable fuzzy_measure_posfuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePosFuzzyMeasurePos and fuzzy_measure_pairsfuzzy_measure_pairsFuzzyMeasurePairsFuzzyMeasurePairsFuzzyMeasurePairs / fuzzy_measure_pairingfuzzy_measure_pairingFuzzyMeasurePairingFuzzyMeasurePairingFuzzyMeasurePairing 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 reset_fuzzy_measurereset_fuzzy_measureResetFuzzyMeasureResetFuzzyMeasureResetFuzzyMeasure.

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 SetTypeSetTypeSetTypeSetTypesetType parameter can be defined, the sub types of a set being mutual exclusive:

A 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 x values represent the edge feature and must lie within the parameter space of the set type, i.e., in case of 'contrast'"contrast""contrast""contrast""contrast" and 'gray'"gray""gray""gray""gray" feature and, e.g., byte images within the range 0.0 <= x <= 255.0. In case of 'size'"size""size""size""size" x has to satisfy 0.0 <= x whereas in case of 'position'"position""position""position""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 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_pairscreate_funct_1d_pairsCreateFunct1dPairsCreateFunct1dPairsCreateFunct1dPairs.

If more than one set is defined, fuzzy_measure_posfuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePosFuzzyMeasurePos / fuzzy_measure_pairsfuzzy_measure_pairsFuzzyMeasurePairsFuzzyMeasurePairsFuzzyMeasurePairs / fuzzy_measure_pairingfuzzy_measure_pairingFuzzyMeasurePairingFuzzyMeasurePairingFuzzyMeasurePairing yield the overall fuzzy weighting by the geometric middle of the weights of each set.

Execution Information

This operator modifies the state of the following input parameter:

The value of this parameter may not be shared across multiple threads without external synchronization.

Parameters

MeasureHandleMeasureHandleMeasureHandleMeasureHandlemeasureHandle (input_control, state is modified)  measure HMeasure, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Measure object handle.

SetTypeSetTypeSetTypeSetTypesetType (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Selection of the fuzzy set.

Default value: 'contrast' "contrast" "contrast" "contrast" "contrast"

List of values: 'contrast'"contrast""contrast""contrast""contrast", 'gray'"gray""gray""gray""gray", 'position'"position""position""position""position", 'position_center'"position_center""position_center""position_center""position_center", 'position_end'"position_end""position_end""position_end""position_end", 'position_first_edge'"position_first_edge""position_first_edge""position_first_edge""position_first_edge", 'position_first_pair'"position_first_pair""position_first_pair""position_first_pair""position_first_pair", 'position_last_edge'"position_last_edge""position_last_edge""position_last_edge""position_last_edge", 'position_last_pair'"position_last_pair""position_last_pair""position_last_pair""position_last_pair", 'position_pair_center'"position_pair_center""position_pair_center""position_pair_center""position_pair_center", 'position_pair_end'"position_pair_end""position_pair_end""position_pair_end""position_pair_end", 'size'"size""size""size""size"

FunctionFunctionFunctionFunctionfunction (input_control)  function_1d HFunction1D, HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (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 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)

Possible Predecessors

gen_measure_arcgen_measure_arcGenMeasureArcGenMeasureArcGenMeasureArc, gen_measure_rectangle2gen_measure_rectangle2GenMeasureRectangle2GenMeasureRectangle2GenMeasureRectangle2, create_funct_1d_pairscreate_funct_1d_pairsCreateFunct1dPairsCreateFunct1dPairsCreateFunct1dPairs, transform_funct_1dtransform_funct_1dTransformFunct1dTransformFunct1dTransformFunct1d

Possible Successors

fuzzy_measure_posfuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePosFuzzyMeasurePos, fuzzy_measure_pairsfuzzy_measure_pairsFuzzyMeasurePairsFuzzyMeasurePairsFuzzyMeasurePairs

Alternatives

set_fuzzy_measure_norm_pairset_fuzzy_measure_norm_pairSetFuzzyMeasureNormPairSetFuzzyMeasureNormPairSetFuzzyMeasureNormPair

See also

reset_fuzzy_measurereset_fuzzy_measureResetFuzzyMeasureResetFuzzyMeasureResetFuzzyMeasure

Module

1D Metrology