【机器视觉】 measure_pairs算子
00. 目錄
文章目錄
- 00. 目錄
- 01. 概述
- 02. 簽名
- 03. 描述
- 04. 注意
- 05. 參數(shù)
- 06. 結(jié)果
- 07. 附錄
01. 概述
measure_pairs - 提取垂直于矩形或環(huán)形弧的直邊對(duì)。
02. 簽名
measure_pairs(Image : : MeasureHandle, Sigma, Threshold, Transition, Select : RowEdgeFirst, ColumnEdgeFirst, AmplitudeFirst, RowEdgeSecond, ColumnEdgeSecond, AmplitudeSecond, IntraDistance, InterDistance)
03. 描述
measure_pairs用于提取垂直于矩形或環(huán)形弧長(zhǎng)軸的直邊對(duì)。
提取算法與measure_pos相同。 此外,邊被分組為:如果Transition =‘positive’,則在RowEdgeFirst和ColumnEdgeFirst中將返回沿矩形長(zhǎng)軸方向的暗到亮過(guò)渡的邊緣點(diǎn)。 在這種情況下,在RowEdgeSecond和ColumnEdgeSecond中將返回具有明到暗過(guò)渡的相應(yīng)邊。 如果Transition = ‘negative’,則行為完全相反。 如果Transition =“all”,則RowEdgeFirst和ColumnEdgeFirst定義為首先檢測(cè)到的邊。 即取決于測(cè)量對(duì)象的定位,返回具有亮暗亮的邊緣對(duì)或具有暗亮暗的邊緣對(duì)。 這適合于測(cè)量具有相對(duì)于背景的不同亮度的物體。
如果找到多個(gè)具有相同過(guò)渡的連續(xù)邊,則將第一個(gè)邊用作邊緣對(duì)的元素。 此行為可能會(huì)導(dǎo)致在應(yīng)用程序中閾值Threshold 不能選擇足夠高,以抑制相同過(guò)渡的連續(xù)邊緣。 對(duì)于這些應(yīng)用,可以使用第二種找邊緣對(duì)模式,僅選擇一系列連續(xù)的上升沿和下降沿的相應(yīng)最強(qiáng)邊沿。 通過(guò)將“_strongest”附加到用于轉(zhuǎn)換的上述任何模式(例如,“negative_strongest”)來(lái)選擇該模式。 最后,可以選擇返回哪個(gè)邊緣對(duì)。 如果Select 設(shè)置為’all’,則返回所有邊緣對(duì)。 如果設(shè)置為’first’,則只返回第一個(gè)提取的邊對(duì),而設(shè)置為’last’,則只返回最后一個(gè)邊緣對(duì)。
提取的邊作為位于矩形長(zhǎng)軸上的單個(gè)點(diǎn)返回。 AmplitudeFirst和AmplitudeSecond中返回相應(yīng)的邊緣振幅。 另外,每個(gè)邊緣對(duì)之間的距離在IntraDistance中返回,連續(xù)兩個(gè)邊緣對(duì)之間的距離在InterDistance中返回。 這里,IntraDistance [i]對(duì)應(yīng)于EdgeFirst [i]和EdgeSecond [i]之間的距離,而InterDistance [i]對(duì)應(yīng)于EdgeSecond [i]和EdgeFirst [i + 1]之間的距離,即,元組InterDistance包含邊緣對(duì)數(shù)量-1個(gè)元素。
原文描述:
measure_pairs 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_pairs is identical to 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 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.
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 Threshold 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’ to any of the above modes for Transition, e.g., ‘negative_strongest’. Finally, it is possible to select which edge pairs are returned. If Select is set to ‘a(chǎn)ll’, all edge pairs are returned. If it is set to ‘first’, only the first of the extracted edge pairs is returned, while it is set to ‘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 AmplitudeFirst and AmplitudeSecond. 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. 注意
只有邊緣是直的并垂直于矩形長(zhǎng)軸,measure_pairs返回的結(jié)果才有意義。 因此,例如它不應(yīng)該用于從曲面對(duì)象中提取邊緣。 此外用戶應(yīng)確保矩形盡可能接近垂直于圖像的邊緣。 此外,Sigma不能大于約 0.5 * Length1(對(duì)于Lenth1請(qǐng)參見(jiàn)gen_measure_rectangle2)。
應(yīng)該記住,為了效率的原因,measure_pairs會(huì)忽略Image的ROI域。 如果圖像中的特定區(qū)域應(yīng)該從measurement中排除,則應(yīng)該生成具有適當(dāng)修改的參數(shù)的新measure對(duì)象。
05. 參數(shù)
Image (input_object) 單通道圖像→ object (byte / uint2 / real)
輸入圖像。
MeasureHandle (input_control) measure_id → (integer)
Measure對(duì)象句柄
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
Threshold (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 ≤ Threshold ≤ 255 (lin)
Minimum increment: 0.5
Recommended increment: 2
Transition (input_control) string → (string)
灰度值過(guò)渡的類型以確定邊緣如何成對(duì)。
Default value: ‘a(chǎn)ll’
List of values: ‘a(chǎn)ll’, ‘a(chǎn)ll_strongest’, ‘negative’, ‘negative_strongest’, ‘positive’, ‘positive_strongest’
Select (input_control) string → (string)
要選擇的邊緣對(duì)
Default value: ‘a(chǎn)ll’
List of values: ‘a(chǎn)ll’, ‘first’, ‘last’
RowEdgeFirst (output_control) point.y-array → (real)
邊緣對(duì)第一條邊的中心的Row坐標(biāo)。
ColumnEdgeFirst (output_control) point.x-array → (real)
邊緣對(duì)第一條邊的中心的Column坐標(biāo)。
AmplitudeFirst (output_control) real-array → (real)
邊緣對(duì)第一條邊的邊緣幅度(帶符號(hào))。
RowEdgeSecond (output_control) point.y-array → (real)
邊緣對(duì)第二條邊的中心的Row坐標(biāo)。
ColumnEdgeSecond (output_control) point.x-array → (real)
邊緣對(duì)第二條邊的中心的Column坐標(biāo)。
AmplitudeSecond (output_control) real-array → (real)
邊緣對(duì)第二條邊的邊緣幅度(帶符號(hào))。
IntraDistance (output_control) real-array → (real)
邊緣對(duì)內(nèi)部之間的距離。
InterDistance (output_control) real-array → (real)
連續(xù)邊緣對(duì)之間的距離。
06. 結(jié)果
如果參數(shù)值正確,則算子measure_pairs將返回值2(H_MSG_TRUE)。 否則會(huì)引發(fā)異常。
HDevelop例程
world_coordinates_line_scan.hdev 使用相機(jī)校準(zhǔn),測(cè)量線掃描圖像中卡尺的間距線之間的距離
two_camera_calibration.hdev 使用特殊的校準(zhǔn)對(duì)象執(zhí)行高精度拼接
pm_measure_board.hdev 定位電路板上的IC并測(cè)量引腳距離
measure_tft_cells.hdev 測(cè)量TFT LCD顯示器的RGB單元的尺寸
measure_switch.hdev 確定開關(guān)的寬度和引腳之間的距離
measure_ring.hdev 用圓形measure對(duì)象確定齒輪的寬度
measure_pin.hdev 測(cè)量IC的引腳
measure_lcd_cells.hdev 測(cè)量分隔LCD顯示器單元的框架的尺寸
measure_ic_leads.hdev 測(cè)量IC的引線
gen_measure_rectangle2.hdev 測(cè)量垂直于給定線的邊緣
fuzzy_measure_switch.hdev 用一個(gè)模糊度量對(duì)象確定一個(gè)開關(guān)引腳的寬度和距離
fuse.hdev 測(cè)量保險(xiǎn)絲的厚度
correct_measure_direction.hdev 自動(dòng)更正測(cè)量對(duì)象的方向
camera_calibration_multi_image.hdev 校準(zhǔn)相機(jī)并測(cè)量卡尺上的位置
camera_calibration_external.hdev 使用相機(jī)校準(zhǔn)來(lái)測(cè)量卡尺上的位置
calibration_aimdpm_1_2006.hdev 在檢查2D數(shù)據(jù)代碼的打印質(zhì)量之前應(yīng)用反射率校準(zhǔn)
calibrate_cameras_telecentric_tilt.hdev 使用遠(yuǎn)心傾斜鏡頭(Scheimpflug)校準(zhǔn)
align_measurements_multithreading.hdev 使用多線程并行檢查剃刀刀片
align_measurements.hdev 使用基于形狀的匹配來(lái)檢查單個(gè)剃刀刀片,以為測(cè)量工具調(diào)整ROI
程序示例
07. 附錄
7.1 機(jī)器視覺(jué)博客匯總
網(wǎng)址:https://dengjin.blog.csdn.net/article/details/116837497
總結(jié)
以上是生活随笔為你收集整理的【机器视觉】 measure_pairs算子的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 【机器视觉】 gen_measure_r
- 下一篇: 【机器视觉】 measure_pos算子