ClassesClassesClassesClasses | | | | Operators

measure_pairsT_measure_pairsMeasurePairsmeasure_pairsMeasurePairsMeasurePairs (Operator)

Name

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

Signature

measure_pairs(Image : : MeasureHandle, Sigma, Threshold, Transition, Select : RowEdgeFirst, ColumnEdgeFirst, AmplitudeFirst, RowEdgeSecond, ColumnEdgeSecond, AmplitudeSecond, IntraDistance, InterDistance)

Herror T_measure_pairs(const Hobject Image, const Htuple MeasureHandle, const Htuple Sigma, const Htuple Threshold, const Htuple Transition, const Htuple Select, Htuple* RowEdgeFirst, Htuple* ColumnEdgeFirst, Htuple* AmplitudeFirst, Htuple* RowEdgeSecond, Htuple* ColumnEdgeSecond, Htuple* AmplitudeSecond, Htuple* IntraDistance, Htuple* InterDistance)

Herror measure_pairs(Hobject Image, const HTuple& MeasureHandle, const HTuple& Sigma, const HTuple& Threshold, const HTuple& Transition, const HTuple& Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance)

HTuple HImage::MeasurePairs(const HMeasure& MeasureHandle, const HTuple& Sigma, const HTuple& Threshold, const HTuple& Transition, const HTuple& Select, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const

HTuple HMeasure::MeasurePairs(const HImage& Image, const HTuple& Sigma, const HTuple& Threshold, const HTuple& Transition, const HTuple& Select, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const

void MeasurePairs(const HObject& Image, const HTuple& MeasureHandle, const HTuple& Sigma, const HTuple& Threshold, const HTuple& Transition, const HTuple& Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance)

void HMeasure::MeasurePairs(const HImage& Image, double Sigma, double Threshold, const HString& Transition, const HString& Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const

void HMeasure::MeasurePairs(const HImage& Image, double Sigma, double Threshold, const char* Transition, const char* Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const

void HImage::MeasurePairs(const HMeasure& MeasureHandle, double Sigma, double Threshold, const HString& Transition, const HString& Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const

void HImage::MeasurePairs(const HMeasure& MeasureHandle, double Sigma, double Threshold, const char* Transition, const char* Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const

void HOperatorSetX.MeasurePairs(
[in] IHUntypedObjectX* Image, [in] VARIANT MeasureHandle, [in] VARIANT Sigma, [in] VARIANT Threshold, [in] VARIANT Transition, [in] VARIANT Select, [out] VARIANT* RowEdgeFirst, [out] VARIANT* ColumnEdgeFirst, [out] VARIANT* AmplitudeFirst, [out] VARIANT* RowEdgeSecond, [out] VARIANT* ColumnEdgeSecond, [out] VARIANT* AmplitudeSecond, [out] VARIANT* IntraDistance, [out] VARIANT* InterDistance)

VARIANT HMeasureX.MeasurePairs(
[in] IHImageX* Image, [in] double Sigma, [in] double Threshold, [in] BSTR Transition, [in] BSTR Select, [out] VARIANT* ColumnEdgeFirst, [out] VARIANT* AmplitudeFirst, [out] VARIANT* RowEdgeSecond, [out] VARIANT* ColumnEdgeSecond, [out] VARIANT* AmplitudeSecond, [out] VARIANT* IntraDistance, [out] VARIANT* InterDistance)

VARIANT HImageX.MeasurePairs(
[in] IHMeasureX* MeasureHandle, [in] double Sigma, [in] double Threshold, [in] BSTR Transition, [in] BSTR Select, [out] VARIANT* ColumnEdgeFirst, [out] VARIANT* AmplitudeFirst, [out] VARIANT* RowEdgeSecond, [out] VARIANT* ColumnEdgeSecond, [out] VARIANT* AmplitudeSecond, [out] VARIANT* IntraDistance, [out] VARIANT* InterDistance)

static void HOperatorSet.MeasurePairs(HObject image, HTuple measureHandle, HTuple sigma, HTuple threshold, HTuple transition, HTuple select, out HTuple rowEdgeFirst, out HTuple columnEdgeFirst, out HTuple amplitudeFirst, out HTuple rowEdgeSecond, out HTuple columnEdgeSecond, out HTuple amplitudeSecond, out HTuple intraDistance, out HTuple interDistance)

void HMeasure.MeasurePairs(HImage image, double sigma, double threshold, string transition, string select, out HTuple rowEdgeFirst, out HTuple columnEdgeFirst, out HTuple amplitudeFirst, out HTuple rowEdgeSecond, out HTuple columnEdgeSecond, out HTuple amplitudeSecond, out HTuple intraDistance, out HTuple interDistance)

void HImage.MeasurePairs(HMeasure measureHandle, double sigma, double threshold, string transition, string select, out HTuple rowEdgeFirst, out HTuple columnEdgeFirst, out HTuple amplitudeFirst, out HTuple rowEdgeSecond, out HTuple columnEdgeSecond, out HTuple amplitudeSecond, out HTuple intraDistance, out HTuple interDistance)

Description

measure_pairsmeasure_pairsMeasurePairsmeasure_pairsMeasurePairsMeasurePairs serves to extract straight edge pairs which lie perpendicular to the major axis of a rectangle or annular arc.

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

The extraction algorithm of measure_pairsmeasure_pairsMeasurePairsmeasure_pairsMeasurePairsMeasurePairs is identical to measure_posmeasure_posMeasurePosmeasure_posMeasurePosMeasurePos. In addition the edges are grouped to pairs: If TransitionTransitionTransitionTransitionTransitiontransition = 'positive'"positive""positive""positive""positive""positive", the edge points with a dark-to-light transition in the direction of the major axis of the rectangle are returned in RowEdgeFirstRowEdgeFirstRowEdgeFirstRowEdgeFirstRowEdgeFirstrowEdgeFirst and ColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstcolumnEdgeFirst. In this case, the corresponding edges with a light-to-dark transition are returned in RowEdgeSecondRowEdgeSecondRowEdgeSecondRowEdgeSecondRowEdgeSecondrowEdgeSecond and ColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondcolumnEdgeSecond. If TransitionTransitionTransitionTransitionTransitiontransition = 'negative'"negative""negative""negative""negative""negative", the behavior is exactly opposite. If TransitionTransitionTransitionTransitionTransitiontransition = 'all'"all""all""all""all""all", the first detected edge defines the transition for RowEdgeFirstRowEdgeFirstRowEdgeFirstRowEdgeFirstRowEdgeFirstrowEdgeFirst and ColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstcolumnEdgeFirst. I.e., dependent on the positioning of the measure object, edge pairs with a light-dark-light transition or edge pairs with a dark-light-dark transition are returned. This is suited, e.g., to measure objects with different brightness relative to the background.

If more than one consecutive edge with the same transition is found, the first one is used as a pair element. This behavior may cause problems in applications in which the threshold ThresholdThresholdThresholdThresholdThresholdthreshold cannot be selected high enough to suppress consecutive edges of the same transition. For these applications, a second pairing mode exists that only selects the respective strongest edges of a sequence of consecutive rising and falling edges. This mode is selected by appending '_strongest'"_strongest""_strongest""_strongest""_strongest""_strongest" to any of the above modes for TransitionTransitionTransitionTransitionTransitiontransition, e.g., 'negative_strongest'"negative_strongest""negative_strongest""negative_strongest""negative_strongest""negative_strongest". Finally, it is possible to select which edge pairs are returned. If SelectSelectSelectSelectSelectselect is set to 'all'"all""all""all""all""all", all edge pairs are returned. If it is set to 'first'"first""first""first""first""first", only the first of the extracted edge pairs is returned, while it is set to 'last'"last""last""last""last""last", only the last one is returned.

The extracted edges are returned as single points which lie on the major axis of the rectangle. The corresponding edge amplitudes are returned in AmplitudeFirstAmplitudeFirstAmplitudeFirstAmplitudeFirstAmplitudeFirstamplitudeFirst and AmplitudeSecondAmplitudeSecondAmplitudeSecondAmplitudeSecondAmplitudeSecondamplitudeSecond. In addition, the distance between each edge pair is returned in IntraDistanceIntraDistanceIntraDistanceIntraDistanceIntraDistanceintraDistance and the distance between consecutive edge pairs is returned in InterDistanceInterDistanceInterDistanceInterDistanceInterDistanceinterDistance. Here, IntraDistance[i] corresponds to the distance between EdgeFirst[i] and EdgeSecond[i], while InterDistance[i] corresponds to the distance between EdgeSecond[i] and EdgeFirst[i+1], i.e., the tuple InterDistanceInterDistanceInterDistanceInterDistanceInterDistanceinterDistance contains one element less than the tuples of the edge pairs.

Attention

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

It should be kept in mind that measure_pairsmeasure_pairsMeasurePairsmeasure_pairsMeasurePairsMeasurePairs ignores the domain of ImageImageImageImageImageimage 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.

Parallelization

Parameters

ImageImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHImageHImageXHobject (byte / uint2 / real)

Input image.

MeasureHandleMeasureHandleMeasureHandleMeasureHandleMeasureHandlemeasureHandle (input_control)  measure_id HMeasure, HTupleHTupleHMeasure, HTupleHMeasureX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Measure object handle.

SigmaSigmaSigmaSigmaSigmasigma (input_control)  number HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Sigma of gaussian smoothing.

Default value: 1.0

Suggested values: 0.4, 0.6, 0.8, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 7.0, 10.0

Typical range of values: 0.4 ≤ Sigma Sigma Sigma Sigma Sigma sigma ≤ 100 (lin)

Minimum increment: 0.01

Recommended increment: 0.1

Restriction: Sigma >= 0.4

ThresholdThresholdThresholdThresholdThresholdthreshold (input_control)  number HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Minimum edge amplitude.

Default value: 30.0

Suggested values: 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 90.0, 110.0

Typical range of values: 1 ≤ Threshold Threshold Threshold Threshold Threshold threshold ≤ 255 (lin)

Minimum increment: 0.5

Recommended increment: 2

TransitionTransitionTransitionTransitionTransitiontransition (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Type of gray value transition that determines how edges are grouped to edge pairs.

Default value: 'all' "all" "all" "all" "all" "all"

List of values: 'all'"all""all""all""all""all", 'all_strongest'"all_strongest""all_strongest""all_strongest""all_strongest""all_strongest", 'negative'"negative""negative""negative""negative""negative", 'negative_strongest'"negative_strongest""negative_strongest""negative_strongest""negative_strongest""negative_strongest", 'positive'"positive""positive""positive""positive""positive", 'positive_strongest'"positive_strongest""positive_strongest""positive_strongest""positive_strongest""positive_strongest"

SelectSelectSelectSelectSelectselect (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Selection of edge pairs.

Default value: 'all' "all" "all" "all" "all" "all"

List of values: 'all'"all""all""all""all""all", 'first'"first""first""first""first""first", 'last'"last""last""last""last""last"

RowEdgeFirstRowEdgeFirstRowEdgeFirstRowEdgeFirstRowEdgeFirstrowEdgeFirst (output_control)  point.y-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Row coordinate of the center of the first edge.

ColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstColumnEdgeFirstcolumnEdgeFirst (output_control)  point.x-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Column coordinate of the center of the first edge.

AmplitudeFirstAmplitudeFirstAmplitudeFirstAmplitudeFirstAmplitudeFirstamplitudeFirst (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Edge amplitude of the first edge (with sign).

RowEdgeSecondRowEdgeSecondRowEdgeSecondRowEdgeSecondRowEdgeSecondrowEdgeSecond (output_control)  point.y-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Row coordinate of the center of the second edge.

ColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondColumnEdgeSecondcolumnEdgeSecond (output_control)  point.x-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Column coordinate of the center of the second edge.

AmplitudeSecondAmplitudeSecondAmplitudeSecondAmplitudeSecondAmplitudeSecondamplitudeSecond (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Edge amplitude of the second edge (with sign).

IntraDistanceIntraDistanceIntraDistanceIntraDistanceIntraDistanceintraDistance (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Distance between edges of an edge pair.

InterDistanceInterDistanceInterDistanceInterDistanceInterDistanceinterDistance (output_control)  real-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Distance between consecutive edge pairs.

Result

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

Possible Predecessors

gen_measure_rectangle2gen_measure_rectangle2GenMeasureRectangle2gen_measure_rectangle2GenMeasureRectangle2GenMeasureRectangle2

Possible Successors

close_measureclose_measureCloseMeasureclose_measureCloseMeasureCloseMeasure

Alternatives

edges_sub_pixedges_sub_pixEdgesSubPixedges_sub_pixEdgesSubPixEdgesSubPix, fuzzy_measure_pairsfuzzy_measure_pairsFuzzyMeasurePairsfuzzy_measure_pairsFuzzyMeasurePairsFuzzyMeasurePairs, fuzzy_measure_pairingfuzzy_measure_pairingFuzzyMeasurePairingfuzzy_measure_pairingFuzzyMeasurePairingFuzzyMeasurePairing

See also

measure_posmeasure_posMeasurePosmeasure_posMeasurePosMeasurePos, fuzzy_measure_posfuzzy_measure_posFuzzyMeasurePosfuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePos

Module

1D Metrology


ClassesClassesClassesClasses | | | | Operators