fuzzy_measure_posT_fuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePosfuzzy_measure_pos (算子)

名称

fuzzy_measure_posT_fuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePosfuzzy_measure_pos — 提取垂直于矩形或环形弧的直边。

签名

fuzzy_measure_pos(Image : : MeasureHandle, Sigma, AmpThresh, FuzzyThresh, Transition : RowEdge, ColumnEdge, Amplitude, FuzzyScore, Distance)

Herror T_fuzzy_measure_pos(const Hobject Image, const Htuple MeasureHandle, const Htuple Sigma, const Htuple AmpThresh, const Htuple FuzzyThresh, const Htuple Transition, Htuple* RowEdge, Htuple* ColumnEdge, Htuple* Amplitude, Htuple* FuzzyScore, Htuple* Distance)

void FuzzyMeasurePos(const HObject& Image, const HTuple& MeasureHandle, const HTuple& Sigma, const HTuple& AmpThresh, const HTuple& FuzzyThresh, const HTuple& Transition, HTuple* RowEdge, HTuple* ColumnEdge, HTuple* Amplitude, HTuple* FuzzyScore, HTuple* Distance)

void HMeasure::FuzzyMeasurePos(const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const HString& Transition, HTuple* RowEdge, HTuple* ColumnEdge, HTuple* Amplitude, HTuple* FuzzyScore, HTuple* Distance) const

void HMeasure::FuzzyMeasurePos(const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const char* Transition, HTuple* RowEdge, HTuple* ColumnEdge, HTuple* Amplitude, HTuple* FuzzyScore, HTuple* Distance) const

void HMeasure::FuzzyMeasurePos(const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const wchar_t* Transition, HTuple* RowEdge, HTuple* ColumnEdge, HTuple* Amplitude, HTuple* FuzzyScore, HTuple* Distance) const   ( Windows only)

void HImage::FuzzyMeasurePos(const HMeasure& MeasureHandle, double Sigma, double AmpThresh, double FuzzyThresh, const HString& Transition, HTuple* RowEdge, HTuple* ColumnEdge, HTuple* Amplitude, HTuple* FuzzyScore, HTuple* Distance) const

void HImage::FuzzyMeasurePos(const HMeasure& MeasureHandle, double Sigma, double AmpThresh, double FuzzyThresh, const char* Transition, HTuple* RowEdge, HTuple* ColumnEdge, HTuple* Amplitude, HTuple* FuzzyScore, HTuple* Distance) const

void HImage::FuzzyMeasurePos(const HMeasure& MeasureHandle, double Sigma, double AmpThresh, double FuzzyThresh, const wchar_t* Transition, HTuple* RowEdge, HTuple* ColumnEdge, HTuple* Amplitude, HTuple* FuzzyScore, HTuple* Distance) const   ( Windows only)

static void HOperatorSet.FuzzyMeasurePos(HObject image, HTuple measureHandle, HTuple sigma, HTuple ampThresh, HTuple fuzzyThresh, HTuple transition, out HTuple rowEdge, out HTuple columnEdge, out HTuple amplitude, out HTuple fuzzyScore, out HTuple distance)

void HMeasure.FuzzyMeasurePos(HImage image, double sigma, double ampThresh, double fuzzyThresh, string transition, out HTuple rowEdge, out HTuple columnEdge, out HTuple amplitude, out HTuple fuzzyScore, out HTuple distance)

void HImage.FuzzyMeasurePos(HMeasure measureHandle, double sigma, double ampThresh, double fuzzyThresh, string transition, out HTuple rowEdge, out HTuple columnEdge, out HTuple amplitude, out HTuple fuzzyScore, out HTuple distance)

def fuzzy_measure_pos(image: HObject, measure_handle: HHandle, sigma: float, amp_thresh: float, fuzzy_thresh: float, transition: str) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

描述

fuzzy_measure_posfuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePosFuzzyMeasurePosfuzzy_measure_pos extracts straight edges which lie perpendicular to the major axis of a rectangle or an annular arc. In addition to measure_posmeasure_posMeasurePosMeasurePosMeasurePosmeasure_pos it uses fuzzy functions to evaluate and select the edges.

For an explanation of the concept of 1D measuring see the introduction of chapter 一维测量

The algorithm of fuzzy_measure_posfuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePosFuzzyMeasurePosfuzzy_measure_pos works by averaging the gray values in “slices” perpendicular to the major axis of the rectangle or annular arc in order to obtain a one-dimensional edge profile. The sampling is done at subpixel positions in the image ImageImageImageImageimageimage at integer row and column distances (in the coordinate frame of the rectangle) from the center of the rectangle. Since this involves some calculations which can be used repeatedly in several measurements, the operator gen_measure_rectangle2gen_measure_rectangle2GenMeasureRectangle2GenMeasureRectangle2GenMeasureRectangle2gen_measure_rectangle2 is used to perform these calculations only once, thus increasing the speed of fuzzy_measure_posfuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePosFuzzyMeasurePosfuzzy_measure_pos significantly. Since there is a trade-off between accuracy and speed in the subpixel calculations of the gray values, and thus in the accuracy of the extracted edge positions, different interpolation schemes can be selected in gen_measure_rectangle2gen_measure_rectangle2GenMeasureRectangle2GenMeasureRectangle2GenMeasureRectangle2gen_measure_rectangle2。(The interpolation only influences rectangles not aligned with the image axes and annular arcs.) The measure object generated with gen_measure_rectangle2gen_measure_rectangle2GenMeasureRectangle2GenMeasureRectangle2GenMeasureRectangle2gen_measure_rectangle2 is passed in MeasureHandleMeasureHandleMeasureHandleMeasureHandlemeasureHandlemeasure_handle

After the one-dimensional edge profile has been calculated, subpixel edge locations are computed by convolving the profile with the derivatives of a Gaussian smoothing kernel of standard deviation SigmaSigmaSigmaSigmasigmasigma. Salient edges can be selected with the parameter AmpThreshAmpThreshAmpThreshAmpThreshampThreshamp_thresh, which constitutes a threshold on the amplitude, i.e., the absolute value of the first derivative of the edge. Additionally, it is possible to select only positive edges, i.e., edges which constitute a dark-to-light transition in the direction of the major axis of the rectangle (TransitionTransitionTransitionTransitiontransitiontransition = 'positive'"positive""positive""positive""positive""positive"), only negative edges, i.e., light-to-dark transitions (TransitionTransitionTransitionTransitiontransitiontransition = 'negative'"negative""negative""negative""negative""negative"), or both types of edges (TransitionTransitionTransitionTransitiontransitiontransition = 'all'"all""all""all""all""all"). Finally, it is possible to select which edge points are returned.

Having extracted subpixel edge locations, features of these edges are evaluated by a corresponding fuzzy function, which can be set by set_fuzzy_measureset_fuzzy_measureSetFuzzyMeasureSetFuzzyMeasureSetFuzzyMeasureset_fuzzy_measure。Which edges are selected can be determined with the parameter FuzzyThreshFuzzyThreshFuzzyThreshFuzzyThreshfuzzyThreshfuzzy_thresh, which constitutes a threshold on the weight over all fuzzy sets, i.e., the geometric mean of the weights of the defined sets.

The selected edges are returned as single points, which lie on the major axis of the rectangle or annular arc, in (RowEdgeRowEdgeRowEdgeRowEdgerowEdgerow_edge, ColumnEdgeColumnEdgeColumnEdgeColumnEdgecolumnEdgecolumn_edge). The corresponding edge amplitudes are returned in AmplitudeAmplitudeAmplitudeAmplitudeamplitudeamplitude, the fuzzy scores in FuzzyScoreFuzzyScoreFuzzyScoreFuzzyScorefuzzyScorefuzzy_score. In addition, the distance between consecutive edge points is returned in DistanceDistanceDistanceDistancedistancedistance. Here, Distance[i] corresponds to the distance between Edge[i] and Edge[i+1], i.e., the tuple DistanceDistanceDistanceDistancedistancedistance contains one element less than the tuples RowEdgeRowEdgeRowEdgeRowEdgerowEdgerow_edge and ColumnEdgeColumnEdgeColumnEdgeColumnEdgecolumnEdgecolumn_edge

注意

fuzzy_measure_posfuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePosFuzzyMeasurePosfuzzy_measure_pos 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_rectangle2GenMeasureRectangle2GenMeasureRectangle2GenMeasureRectangle2gen_measure_rectangle2).

It should be kept in mind that fuzzy_measure_posfuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePosFuzzyMeasurePosfuzzy_measure_pos 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.

执行信息

参数

ImageImageImageImageimageimage (输入对象)  singlechannelimage objectHImageHObjectHImageHobject (byte / uint2 / real)

输入图像。

MeasureHandleMeasureHandleMeasureHandleMeasureHandlemeasureHandlemeasure_handle (输入控制)  measure HMeasure, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Measure object handle.

SigmaSigmaSigmaSigmasigmasigma (输入控制)  number HTuplefloatHTupleHtuple (real) (double) (double) (double)

Sigma of Gaussian smoothing.

默认值: 1.0

建议值: 0.4, 0.6, 0.8, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 7.0, 10.0

值范围: 0.4 ≤ Sigma Sigma Sigma Sigma sigma sigma ≤ 100 (lin)

最小增量: 0.01

建议增量: 0.1

AmpThreshAmpThreshAmpThreshAmpThreshampThreshamp_thresh (输入控制)  number HTuplefloatHTupleHtuple (real) (double) (double) (double)

最小边缘振幅。

默认值: 30.0

建议值: 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 90.0, 110.0

值范围: 1 ≤ AmpThresh AmpThresh AmpThresh AmpThresh ampThresh amp_thresh ≤ 255 (lin)

最小增量: 0.5

建议增量: 2

FuzzyThreshFuzzyThreshFuzzyThreshFuzzyThreshfuzzyThreshfuzzy_thresh (输入控制)  number HTuplefloatHTupleHtuple (real) (double) (double) (double)

Minimum fuzzy value.

默认值: 0.5

建议值: 0.1, 0.3, 0.5, 0.6, 0.7, 0.9

值范围: 0.0 ≤ FuzzyThresh FuzzyThresh FuzzyThresh FuzzyThresh fuzzyThresh fuzzy_thresh ≤ 1.0 (lin)

建议增量: 0.1

TransitionTransitionTransitionTransitiontransitiontransition (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Select light/dark or dark/light edges.

默认值: 'all' "all" "all" "all" "all" "all"

值列表: 'all'"all""all""all""all""all", 'negative'"negative""negative""negative""negative""negative", 'positive'"positive""positive""positive""positive""positive"

RowEdgeRowEdgeRowEdgeRowEdgerowEdgerow_edge (输出控制)  point.y-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Row coordinate of the edge point.

ColumnEdgeColumnEdgeColumnEdgeColumnEdgecolumnEdgecolumn_edge (输出控制)  point.x-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Column coordinate of the edge point.

AmplitudeAmplitudeAmplitudeAmplitudeamplitudeamplitude (输出控制)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Edge amplitude of the edge (with sign).

FuzzyScoreFuzzyScoreFuzzyScoreFuzzyScorefuzzyScorefuzzy_score (输出控制)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Fuzzy evaluation of the edges.

DistanceDistanceDistanceDistancedistancedistance (输出控制)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Distance between consecutive edges.

结果

如果参数值正确,算子 fuzzy_measure_posfuzzy_measure_posFuzzyMeasurePosFuzzyMeasurePosFuzzyMeasurePosfuzzy_measure_pos 返回值 2 ( H_MSG_TRUE )。否则将抛出异常。

可能的前趋

gen_measure_rectangle2gen_measure_rectangle2GenMeasureRectangle2GenMeasureRectangle2GenMeasureRectangle2gen_measure_rectangle2, gen_measure_arcgen_measure_arcGenMeasureArcGenMeasureArcGenMeasureArcgen_measure_arc, set_fuzzy_measureset_fuzzy_measureSetFuzzyMeasureSetFuzzyMeasureSetFuzzyMeasureset_fuzzy_measure

可能的后继

close_measureclose_measureCloseMeasureCloseMeasureCloseMeasureclose_measure

替代

edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPixedges_sub_pix, measure_posmeasure_posMeasurePosMeasurePosMeasurePosmeasure_pos

另见

fuzzy_measure_pairingfuzzy_measure_pairingFuzzyMeasurePairingFuzzyMeasurePairingFuzzyMeasurePairingfuzzy_measure_pairing, fuzzy_measure_pairsfuzzy_measure_pairsFuzzyMeasurePairsFuzzyMeasurePairsFuzzyMeasurePairsfuzzy_measure_pairs, measure_pairsmeasure_pairsMeasurePairsMeasurePairsMeasurePairsmeasure_pairs

模块

一维计量