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