【机器视觉】 fuzzy_measure_pairs算子
00. 目錄
文章目錄
- 00. 目錄
- 01. 概述
- 02. 簽名
- 03. 描述
- 04. 注意
- 05. 參數(shù)
- 06. 結(jié)果
- 07. 附錄
01. 概述
fuzzy_measure_pairs - 提取垂直于矩形或環(huán)形弧的直邊對。
02. 簽名
fuzzy_measure_pairs(Image : : MeasureHandle, Sigma, AmpThresh, FuzzyThresh, Transition : RowEdgeFirst, ColumnEdgeFirst, AmplitudeFirst, RowEdgeSecond, ColumnEdgeSecond, AmplitudeSecond, RowEdgeCenter, ColumnEdgeCenter, FuzzyScore, IntraDistance, InterDistance)
03. 描述
fuzzy_measure_pairs用于提取垂直于矩形或環(huán)形弧長軸的直邊對。 與measure_pairs不同的是,它還使用模糊函數(shù)來判斷和選擇邊緣對。
提取算法與fuzzy_measure_pos相同。 另外,相鄰的邊被分組成對。 要提取彼此相交或包含的對,請使用fuzzy_measure_pairing。
如果Transition =‘positive’,則在RowEdgeFirst和ColumnEdgeFirst中將返回沿矩形或圓弧的長軸方向的暗到明轉(zhuǎn)換的邊緣點(diǎn)。 在這種情況下,在RowEdgeSecond和ColumnEdgeSecond中將返回具有明暗過渡的相應(yīng)邊。 如果Transition =‘negative’,則效果完全相反。 如果Transition =“all”,則首先檢測到的邊將定義RowEdgeFirst和ColumnEdgeFirst的轉(zhuǎn)換。 即,取決于測量對象的定位,返回具有明暗過渡的邊緣對或具有暗明過渡的邊緣對。 這適合于例如測量具有相對于背景的不同亮度的物體。
在提取了子像素邊緣位置之后,邊緣是成對的。 配對算法對邊緣進(jìn)行分組,從而禁止邊緣對待交織和包含。 邊緣對的特征由模糊函數(shù)評估,可以通過set_fuzzy_measure或set_fuzzy_measure_norm_pair來設(shè)置。(在候選邊緣對中) 選擇哪個(gè)邊緣對可以用參數(shù)FuzzyThresh來確定,該參數(shù)構(gòu)成了所有模糊集上權(quán)重的閾值,即所定義的模糊函數(shù)的權(quán)重的幾何平均值。(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 functions.)
選定的邊將作為單個(gè)點(diǎn)返回,這些點(diǎn)位于矩形或環(huán)形弧的長軸上。 相應(yīng)的邊緣振幅在AmplitudeFirst和AmplitudeSecond中返回,返回模糊分?jǐn)?shù)到FuzzyScore。 另外,每個(gè)邊緣對之間的距離在IntraDistance中返回,連續(xù)邊緣對之間的距離在InterDistance中返回。 這里,IntraDistance [i]對應(yīng)于EdgeFirst [i]和EdgeSecond [i]之間的距離,而InterDistance [i]對應(yīng)于EdgeSecond [i]和EdgeFirst [i + 1]之間的距離,即,元組InterDistance包含(邊緣對元組長度-1)個(gè)元素。
原文描述:
fuzzy_measure_pairs serves to extract straight edge pairs which lie perpendicular to the major axis of a rectangle or an annular arc. In addition to measure_pairs it uses fuzzy functions to evaluate and select the edge pairs.
For an explanation of the concept of 1D measuring see the introduction of chapter 1D Measuring.
The extraction algorithm of fuzzy_measure_pairs is identical to fuzzy_measure_pos. In addition, neighboring edges are grouped to pairs. To extract pairs that intersect or include each other, use fuzzy_measure_pairing.
If Transition = ‘positive’, the edge points with a dark-to-light transition in the direction of the major axis of the rectangle or 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 = ‘a(chǎn)ll’, the first detected edge defines the transition for RowEdgeFirst and ColumnEdgeFirst. 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.
Having extracted subpixel edge locations, the edges are paired. The pairing algorithm groups the edges such that interleavings and inclusions of pairs are prohibited. The features of an edge pair are evaluated by a fuzzy function, which can be set by set_fuzzy_measure or set_fuzzy_measure_norm_pair. 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 functions.
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 and the distance between consecutive edge pairs is returned in InterDistance. 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 InterDistance contains one element less than the tuples of the edge pairs.
執(zhí)行信息
● 多線程類型:可重入(與非獨(dú)占算子并行運(yùn)行)。
● 多線程范圍:全局(可以從任何線程調(diào)用)。
● 不并行處理。
04. 注意
只有在邊緣是直的并且垂直于矩形或環(huán)形弧長軸的情況下,fuzzy_measure_pairs返回的結(jié)果才有意義。 因此,例如,它不應(yīng)該用于從曲面對象中提取邊緣。 此外,用戶應(yīng)確保矩形或環(huán)形弧盡可能接近垂直于圖像中的邊緣。 此外,西格瑪不能大于約 0.5 *Length1(對于Length1請參見gen_measure_rectangle2)。
05. 參數(shù)
Image (input_object) singlechannelimage → object (byte / uint2 / real)
輸入圖像。
MeasureHandle (input_control) measure_id → (integer)
measure對象句柄。
Sigma (input_control) number → (real)
高斯模糊的Sigma。
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)
最小邊緣幅度。
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)
最小模糊值。
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)
選擇邊緣對的第一個(gè)灰度值轉(zhuǎn)換。
Default value: ‘a(chǎn)ll’
List of values: ‘a(chǎn)ll’, ‘negative’, ‘positive’
RowEdgeFirst (output_control) point.y-array → (real)
邊緣對的第一個(gè)邊緣點(diǎn)的Row坐標(biāo)。
ColumnEdgeFirst (output_control) point.x-array → (real)
邊緣對的第一個(gè)邊緣點(diǎn)的Column坐標(biāo)。
AmplitudeFirst (output_control) real-array → (real)
邊緣對第一條邊的邊緣幅度(帶符號)。
RowEdgeSecond (output_control) point.y-array → (real)
邊緣對的第二個(gè)邊緣點(diǎn)的Row坐標(biāo)。
ColumnEdgeSecond (output_control) point.x-array → (real)
邊緣對的第二個(gè)邊緣點(diǎn)的Column坐標(biāo)。
AmplitudeSecond (output_control) real-array → (real)
邊緣對第二條邊的邊緣幅度(帶符號)。
RowEdgeCenter (output_control) point.y-array → (real)
邊緣對的中心的Row坐標(biāo)。
ColumnEdgeCenter (output_control) point.x-array → (real)
邊緣對的中心的Column坐標(biāo)。
FuzzyScore (output_control) real-array → (real)
邊緣對的模糊評估分?jǐn)?shù)。
IntraDistance (output_control) real-array → (real)
邊緣對內(nèi)部的距離。
InterDistance (output_control) real-array → (real)
連續(xù)邊緣對之間的距離。
06. 結(jié)果
如果參數(shù)值正確,則算子fuzzy_measure_pairs將返回值2(H_MSG_TRUE)。 否則會引發(fā)異常。
HDevelop例程
fuzzy_measure_switch.hdev 用一個(gè)模糊measure對象確定一個(gè)開關(guān)引腳的寬度和距離
fuzzy_measure_pin.hdev 使用模糊measure來測量IC的引腳
程序示例
07. 附錄
7.1 機(jī)器視覺博客匯總
網(wǎng)址:https://dengjin.blog.csdn.net/article/details/116837497
總結(jié)
以上是生活随笔為你收集整理的【机器视觉】 fuzzy_measure_pairs算子的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【机器视觉】 fuzzy_measure
- 下一篇: 【机器视觉】 fuzzy_measure