fuzzy_measure_pairing ( Image : : MeasureHandle, Sigma, AmpThresh, FuzzyThresh, Transition, Pairing, NumPairs : RowEdgeFirst, ColumnEdgeFirst, AmplitudeFirst, RowEdgeSecond, ColumnEdgeSecond, AmplitudeSecond, RowPairCenter, ColumnPairCenter, FuzzyScore, IntraDistance )
Extract straight edge pairs perpendicular to a rectangle or an
annular arc.
fuzzy_measure_pairing serves to extract straight edge
pairs that lie perpendicular to the major axis of a
rectangle or an annular arc. In addition to measure_pos it uses
fuzzy member functions to evaluate and select the edge pairs.
The extraction algorithm is identical to fuzzy_measure_pos.
In addition, the edges are grouped to pairs: If Transition =
'positive', the edge points with a dark-to-light transition
in the direction of the major axis of the rectangle or the annular arc
are returned in
RowEdgeFirst and ColumnEdgeFirst. In this case,
the corresponding edges with a light-to-dark transition are returned
in RowEdgeSecond and ColumnEdgeSecond. If
Transition = 'negative', the behavior is exactly
opposite. If Transition = 'all', the first
detected edge defines the transition for RowEdgeFirst and
ColumnEdgeFirst.
Having extracted subpixel edge locations, the edges are paired. The
features of a possible edge pair are evaluated by a fuzzy function,
set by set_fuzzy_measure. Which edge pairs are selected can be
determined with the parameter FuzzyThresh,
which constitutes a threshold on the weight over all fuzzy sets,
i.e., the geometric mean of the weights of the defined fuzzy membership
functions. As an extension to fuzzy_measure_pairs, the pairing
algorithm can be restricted by Pairing. Currently only
'no_restriction' is available, which returns all possible
edge pairs, allowing interleaving and inclusion of pairs. Finally,
the best scored NumPairs 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 AmplitudeFirst and
AmplitudeSecond, the fuzzy scores in FuzzyScore.
In addition, the distance between each edge pair is returned in
IntraDistance, corresponding to the distance
between EdgeFirst[i] and EdgeSecond[i].
Attention
fuzzy_measure_pairing 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, Sigma must not become larger than
approx. 0.5 * Length1 (for Length1 see
gen_measure_rectangle2).
It should be kept in mind that fuzzy_measure_pairing ignores
the domain of Image 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.
Parameters
Image (input_object)
|
singlechannelimage -> object : byte / uint2
|
|
Input image. |
MeasureHandle (input_control)
|
measure_id -> integer
|
|
Measure object handle. |
Sigma (input_control)
|
number -> real
|
|
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 <= 100 (lin) |
|
Minimum increment: 0.01
|
Recommended increment: 0.1
|
|
Restriction: Sigma >= 0.4 |
AmpThresh (input_control)
|
number -> real
|
|
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 <= AmpThresh <= 255 (lin) |
|
Minimum increment: 0.5
|
Recommended increment: 2
|
FuzzyThresh (input_control)
|
number -> real
|
|
Minimum fuzzy value. |
|
Default value: 0.5 |
|
Suggested values: 0.1, 0.3, 0.5, 0.7, 0.9 |
|
Typical range of values: 0.0 <= FuzzyThresh <= 1.0 (lin) |
Recommended increment: 0.1
|
Transition (input_control)
|
string -> string
|
|
Select the first gray value transition of the edge pairs. |
|
Default value: 'all' |
|
List of values: 'all', 'positive', 'negative' |
Pairing (input_control)
|
string -> string
|
|
Constraint of pairing. |
|
Default value: 'no_restriction' |
|
List of values: 'no_restriction' |
NumPairs (input_control)
|
number -> integer
|
|
Number of edge pairs. |
|
Default value: 10 |
|
Suggested values: 0, 1, 10, 20, 50 |
|
Typical range of values: 0 <= NumPairs |
Recommended increment: 1
|
RowEdgeFirst (output_control)
|
point.y-array -> real
|
|
Row coordinate of the first edge. |
ColumnEdgeFirst (output_control)
|
point.x-array -> real
|
|
Column coordinate of the first edge. |
AmplitudeFirst (output_control)
|
real-array -> real
|
|
Edge amplitude of the first edge (with sign). |
RowEdgeSecond (output_control)
|
point.y-array -> real
|
|
Row coordinate of the second edge. |
ColumnEdgeSecond (output_control)
|
point.x-array -> real
|
|
Column coordinate of the second edge. |
AmplitudeSecond (output_control)
|
real-array -> real
|
|
Edge amplitude of the second edge (with sign). |
RowPairCenter (output_control)
|
point.y-array -> real
|
|
Row coordinate of the center of the edge pair. |
ColumnPairCenter (output_control)
|
point.x-array -> real
|
|
Column coordinate of the center of the edge pair. |
FuzzyScore (output_control)
|
real-array -> real
|
|
Fuzzy evaluation of the edge pair. |
IntraDistance (output_control)
|
real-array -> real
|
|
Distance between the edges of the edge pair. |
Result
If the parameter values are correct the operator
fuzzy_measure_pairing returns the value 2 (H_MSG_TRUE). Otherwise an
exception handling is raised.
Parallelization Information
fuzzy_measure_pairing is reentrant and processed without parallelization.
Possible Predecessors
gen_measure_rectangle2,
gen_measure_arc,
set_fuzzy_measure
Possible Successors
close_measure
Alternatives
edges_sub_pix,
fuzzy_measure_pairs,
measure_pairs
See also
fuzzy_measure_pos,
measure_pos
Module
1D Metrology
Copyright © 1996-2008 MVTec Software GmbH