Skip to content

fuzzy_measure_pairingfuzzy_measure_pairingFuzzyMeasurePairingFuzzyMeasurePairingfuzzy_measure_pairingT_fuzzy_measure_pairing🔗

Short description🔗

fuzzy_measure_pairingfuzzy_measure_pairingFuzzyMeasurePairingFuzzyMeasurePairingfuzzy_measure_pairingT_fuzzy_measure_pairing — Extract straight edge pairs perpendicular to a rectangle or an annular arc.

Signature🔗

fuzzy_measure_pairing( image Image, measure MeasureHandle, number Sigma, number AmpThresh, number FuzzyThresh, string Transition, string Pairing, number NumPairs, out point.y RowEdgeFirst, out point.x ColumnEdgeFirst, out real AmplitudeFirst, out point.y RowEdgeSecond, out point.x ColumnEdgeSecond, out real AmplitudeSecond, out point.y RowPairCenter, out point.x ColumnPairCenter, out real FuzzyScore, out real IntraDistance )fuzzy_measure_pairing( Image : : MeasureHandle, Sigma, AmpThresh, FuzzyThresh, Transition, Pairing, NumPairs : RowEdgeFirst, ColumnEdgeFirst, AmplitudeFirst, RowEdgeSecond, ColumnEdgeSecond, AmplitudeSecond, RowPairCenter, ColumnPairCenter, FuzzyScore, IntraDistance )void FuzzyMeasurePairing( const HObject& Image, const HTuple& MeasureHandle, const HTuple& Sigma, const HTuple& AmpThresh, const HTuple& FuzzyThresh, const HTuple& Transition, const HTuple& Pairing, const HTuple& NumPairs, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* RowPairCenter, HTuple* ColumnPairCenter, HTuple* FuzzyScore, HTuple* IntraDistance )static void HOperatorSet.FuzzyMeasurePairing( HObject image, HTuple measureHandle, HTuple sigma, HTuple ampThresh, HTuple fuzzyThresh, HTuple transition, HTuple pairing, HTuple numPairs, out HTuple rowEdgeFirst, out HTuple columnEdgeFirst, out HTuple amplitudeFirst, out HTuple rowEdgeSecond, out HTuple columnEdgeSecond, out HTuple amplitudeSecond, out HTuple rowPairCenter, out HTuple columnPairCenter, out HTuple fuzzyScore, out HTuple intraDistance )def fuzzy_measure_pairing( image: HObject, measure_handle: HHandle, sigma: float, amp_thresh: float, fuzzy_thresh: float, transition: str, pairing: str, num_pairs: int ) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

Herror T_fuzzy_measure_pairing( const Hobject Image, const Htuple MeasureHandle, const Htuple Sigma, const Htuple AmpThresh, const Htuple FuzzyThresh, const Htuple Transition, const Htuple Pairing, const Htuple NumPairs, Htuple* RowEdgeFirst, Htuple* ColumnEdgeFirst, Htuple* AmplitudeFirst, Htuple* RowEdgeSecond, Htuple* ColumnEdgeSecond, Htuple* AmplitudeSecond, Htuple* RowPairCenter, Htuple* ColumnPairCenter, Htuple* FuzzyScore, Htuple* IntraDistance )

void HMeasure::FuzzyMeasurePairing( const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const HString& Transition, const HString& Pairing, Hlong NumPairs, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* RowPairCenter, HTuple* ColumnPairCenter, HTuple* FuzzyScore, HTuple* IntraDistance ) const

void HMeasure::FuzzyMeasurePairing( const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const char* Transition, const char* Pairing, Hlong NumPairs, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* RowPairCenter, HTuple* ColumnPairCenter, HTuple* FuzzyScore, HTuple* IntraDistance ) const

void HMeasure::FuzzyMeasurePairing( const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const wchar_t* Transition, const wchar_t* Pairing, Hlong NumPairs, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* RowPairCenter, HTuple* ColumnPairCenter, HTuple* FuzzyScore, HTuple* IntraDistance ) const (Windows only)

void HImage::FuzzyMeasurePairing( const HMeasure& MeasureHandle, double Sigma, double AmpThresh, double FuzzyThresh, const HString& Transition, const HString& Pairing, Hlong NumPairs, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* RowPairCenter, HTuple* ColumnPairCenter, HTuple* FuzzyScore, HTuple* IntraDistance ) const

void HImage::FuzzyMeasurePairing( const HMeasure& MeasureHandle, double Sigma, double AmpThresh, double FuzzyThresh, const char* Transition, const char* Pairing, Hlong NumPairs, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* RowPairCenter, HTuple* ColumnPairCenter, HTuple* FuzzyScore, HTuple* IntraDistance ) const

void HImage::FuzzyMeasurePairing( const HMeasure& MeasureHandle, double Sigma, double AmpThresh, double FuzzyThresh, const wchar_t* Transition, const wchar_t* Pairing, Hlong NumPairs, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* RowPairCenter, HTuple* ColumnPairCenter, HTuple* FuzzyScore, HTuple* IntraDistance ) const (Windows only)

void HMeasure.FuzzyMeasurePairing( HImage image, double sigma, double ampThresh, double fuzzyThresh, string transition, string pairing, int numPairs, out HTuple rowEdgeFirst, out HTuple columnEdgeFirst, out HTuple amplitudeFirst, out HTuple rowEdgeSecond, out HTuple columnEdgeSecond, out HTuple amplitudeSecond, out HTuple rowPairCenter, out HTuple columnPairCenter, out HTuple fuzzyScore, out HTuple intraDistance )

void HImage.FuzzyMeasurePairing( HMeasure measureHandle, double sigma, double ampThresh, double fuzzyThresh, string transition, string pairing, int numPairs, out HTuple rowEdgeFirst, out HTuple columnEdgeFirst, out HTuple amplitudeFirst, out HTuple rowEdgeSecond, out HTuple columnEdgeSecond, out HTuple amplitudeSecond, out HTuple rowPairCenter, out HTuple columnPairCenter, out HTuple fuzzyScore, out HTuple intraDistance )

Description🔗

fuzzy_measure_pairingFuzzyMeasurePairing serves to extract straight edge pairs that lie perpendicular to the major axis of a rectangle or an annular arc.

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

The extraction algorithm of fuzzy_measure_pairingFuzzyMeasurePairing is identical to fuzzy_measure_pairsFuzzyMeasurePairs (see there for details) with the exception, that it is also possible to extract interleaving and included pairs using the parameter Pairingpairingpairing. Currently only 'no_restriction'"no_restriction" is available, which returns all possible edge pairs, allowing interleaving and inclusion of pairs.

Only the best scored NumPairsnumPairsnum_pairs edge pairs are returned, whereas 0 indicates to return all possible found edge combinations.

The selected edges are returned as single points, which lie on the major axis of the rectangle or annular arc. The corresponding edge amplitudes are returned in AmplitudeFirstamplitudeFirstamplitude_first and AmplitudeSecondamplitudeSecondamplitude_second, the fuzzy scores in FuzzyScorefuzzyScorefuzzy_score. In addition, the distance between each edge pair is returned in IntraDistanceintraDistanceintra_distance, corresponding to the distance between EdgeFirst[i] and EdgeSecond[i].

Attention🔗

fuzzy_measure_pairingFuzzyMeasurePairing only returns meaningful results if the assumptions that the edges are straight and perpendicular to the major axis of the rectangle or annular arc are fulfilled. Thus, it should not be used to extract edges from curved objects, for example. Furthermore, the user should ensure that the rectangle or annular arc is as close to perpendicular as possible to the edges in the image. Additionally, Sigmasigmasigma must not become larger than approx. 0.5 * Length1 (for Length1 see gen_measure_rectangle2GenMeasureRectangle2).

It should be kept in mind that fuzzy_measure_pairingFuzzyMeasurePairing ignores the domain of Imageimageimage for efficiency reasons. If certain regions in the image should be excluded from the measurement a new measure object with appropriately modified parameters should be generated.

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.

Parameters🔗

Imageimageimage (input_object) singlechannelimage → object (byte / uint2 / real)object (byte / uint2 / real)HObject (byte / uint2 / real)HImage (byte / uint2 / real)HObject (byte / uint2 / real)Hobject (byte / uint2 / real)

Input image.

MeasureHandlemeasureHandlemeasure_handle (input_control) measure → (handle)(handle)HTuple (HHandle)HMeasure, HTuple (IntPtr)HHandleHtuple (handle)

Measure object handle.

Sigmasigmasigma (input_control) number → (real)(real)HTuple (double)HTuple (double)floatHtuple (double)

Sigma of Gaussian smoothing.

Default: 1.01.0
Suggested values: 0.4, 0.6, 0.8, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 7.0, 10.00.4, 0.6, 0.8, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 7.0, 10.0
Value range: 0.4 ≤ Sigma ≤ 100 (lin)
Minimum increment: 0.01
Recommended increment: 0.1

AmpThreshampThreshamp_thresh (input_control) number → (real)(real)HTuple (double)HTuple (double)floatHtuple (double)

Minimum edge amplitude.

Default: 30.030.0
Suggested values: 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 90.0, 110.05.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 90.0, 110.0
Value range: 1 ≤ AmpThresh ≤ 255 (lin)
Minimum increment: 0.5
Recommended increment: 2

FuzzyThreshfuzzyThreshfuzzy_thresh (input_control) number → (real)(real)HTuple (double)HTuple (double)floatHtuple (double)

Minimum fuzzy value.

Default: 0.50.5
Suggested values: 0.1, 0.3, 0.5, 0.7, 0.90.1, 0.3, 0.5, 0.7, 0.9
Value range: 0.0 ≤ FuzzyThresh ≤ 1.0 (lin)
Recommended increment: 0.1

Transitiontransitiontransition (input_control) string → (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Select the first gray value transition of the edge pairs.

Default: 'all'"all"
List of values: 'all', 'negative', 'positive'"all", "negative", "positive"

Pairingpairingpairing (input_control) string → (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Constraint of pairing.

Default: 'no_restriction'"no_restriction"
List of values: 'no_restriction'"no_restriction"

NumPairsnumPairsnum_pairs (input_control) number → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of edge pairs.

Default: 1010
Suggested values: 0, 1, 10, 20, 500, 1, 10, 20, 50
Value range: 0 ≤ NumPairs
Recommended increment: 1

RowEdgeFirstrowEdgeFirstrow_edge_first (output_control) point.y-array → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Row coordinate of the first edge.

ColumnEdgeFirstcolumnEdgeFirstcolumn_edge_first (output_control) point.x-array → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Column coordinate of the first edge.

AmplitudeFirstamplitudeFirstamplitude_first (output_control) real-array → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Edge amplitude of the first edge (with sign).

RowEdgeSecondrowEdgeSecondrow_edge_second (output_control) point.y-array → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Row coordinate of the second edge.

ColumnEdgeSecondcolumnEdgeSecondcolumn_edge_second (output_control) point.x-array → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Column coordinate of the second edge.

AmplitudeSecondamplitudeSecondamplitude_second (output_control) real-array → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Edge amplitude of the second edge (with sign).

RowPairCenterrowPairCenterrow_pair_center (output_control) point.y-array → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Row coordinate of the center of the edge pair.

ColumnPairCentercolumnPairCentercolumn_pair_center (output_control) point.x-array → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Column coordinate of the center of the edge pair.

FuzzyScorefuzzyScorefuzzy_score (output_control) real-array → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Fuzzy evaluation of the edge pair.

IntraDistanceintraDistanceintra_distance (output_control) real-array → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Distance between the edges of the edge pair.

Result🔗

If the parameter values are correct the operator fuzzy_measure_pairingFuzzyMeasurePairing returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

gen_measure_rectangle2GenMeasureRectangle2, gen_measure_arcGenMeasureArc, set_fuzzy_measureSetFuzzyMeasure

Possible successors

close_measureCloseMeasure

Alternatives

edges_sub_pixEdgesSubPix, fuzzy_measure_pairsFuzzyMeasurePairs, measure_pairsMeasurePairs

See also

fuzzy_measure_posFuzzyMeasurePos, measure_posMeasurePos

Module🔗

1D Metrology