【机器视觉】 gen_measure_arc算子
00. 目錄
文章目錄
- 00. 目錄
- 01. 概述
- 02. 簽名
- 03. 描述
- 04. 注意
- 05. 參數
- 06. 結果
- 07. 附錄
01. 概述
gen_measure_arc - 準備提取垂直于圓弧的直邊。
02. 簽名
gen_measure_arc( : : CenterRow, CenterCol, Radius, AngleStart, AngleExtent, AnnulusRadius, Width, Height, Interpolation : MeasureHandle)
03. 描述
gen_measure_arc準備提取垂直于環形弧的直邊。 這里,環形弧表示具有相關寬度的圓弧。 圓弧的中心在CenterRow和CenterCol,其半徑為Radius,起始角度為AngleStart,AngleExtent是相對于起始角度的角度范圍。 如果AngleExtent> 0,則產生逆時針方向的弧,否則產生順時針方向的弧。 環形弧的半徑,即寬度的一半由AnnulusRadius確定。
在算子measure_pos的文檔中描述了邊緣提取算法。 如上所述,可以使用不同類型的插值來計算一維灰度值分布。 對于Interpolation=‘bilinear’,測量中的灰度值是從最接近的像素的灰度值,即通過constant插值獲得的。 對于Interpolation = ‘bilinear’,使用雙線性插值,而對于Interpolation = ‘bicubic’,則使用雙三次插值。
要以最佳速度執行實際測量,所有可用于多次測量的計算都已在算子gen_measure_arc中執行。 為此,在MeasureHandle中構造并返回一個優化的數據結構,即所謂的measure對象。 要在其中執行測量的圖像的大小必須在參數Width和Height中指定。
系統參數“int_zooming”(見set_system)會影響用于構建measure對象的計算的準確性和速度。 如果’int_zooming’設置為’true’,則內部計算使用定點算術執行,導致執行時間縮短。 但是,這種模式下的幾何精度略低。 如果將“int_zooming”設置為“false”,則使用浮點運算執行內部計算,從而導致最大的幾何精度,但也會顯著增加執行時間。
原文描述:
gen_measure_arc prepares the extraction of straight edges which lie perpendicular to an annular arc. Here, annular arc denotes a circular arc with an associated width. The center of the arc is passed in the parameters CenterRow and CenterCol, its radius in Radius, the starting angle in AngleStart, and its angular extent relative to the starting angle in AngleExtent. If AngleExtent > 0, an arc with counterclockwise orientation is generated, otherwise an arc with clockwise orientation. The radius of the annular arc, i.e., half its width, is determined by AnnulusRadius.
For an explanation of the concept of 1D measuring see the introduction of chapter 1D Measuring.
The edge extraction algorithm is described in the documentation of the operator measure_pos. As discussed there, different types of interpolation can be used for the calculation of the one-dimensional gray value profile. For Interpolation = ‘nearest_neighbor’, the gray values in the measurement are obtained from the gray values of the closest pixel, i.e., by constant interpolation. For Interpolation = ‘bilinear’, bilinear interpolation is used, while for Interpolation = ‘bicubic’, bicubic interpolation is used.
To perform the actual measurement at optimal speed, all computations that can be used for multiple measurements are already performed in the operator gen_measure_arc. For this, an optimized data structure, a so-called measure object, is constructed and returned in MeasureHandle. The size of the images in which measurements will be performed must be specified in the parameters Width and Height.
The system parameter ‘int_zooming’ (see set_system) affects the accuracy and speed of the calculations used to construct the measure object. If ‘int_zooming’ is set to ‘true’, the internal calculations are performed using fixed point arithmetic, leading to much shorter execution times. However, the geometric accuracy is slightly lower in this mode. If ‘int_zooming’ is set to ‘false’, the internal calculations are performed using floating point arithmetic, leading to the maximum geometric accuracy, but also to significantly increased execution times.
執行信息
● 多線程類型:可重入(與非獨占算子并行運行)。
● 多線程范圍:全局(可以從任何線程調用)。
● 不并行處理。
該算子返回一個句柄。 請注意,即使將此句柄用作輸入參數,該句柄類型的實例的狀態也可能被特定的算子所改變。
04. 注意
請注意,使用雙線性或雙三次插值時,不僅矩形的測量,而且矩形周圍的邊緣必須在圖像中。 對于雙線性插值而言,邊緣的寬度(在所有四個方向上)必須至少有一個像素,對于雙三次插值必須至少有兩個像素。 對于不滿足此條件的投影線,不計算灰度值。 因此,在這些位置上不能提取邊緣。
05. 參數
CenterRow (input_control) point.y → (real / integer)
圓弧中心的Row坐標。
Default value: 100.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0
Typical range of values: 0.0 ≤ CenterRow ≤ 511.0 (lin)
Minimum increment: 1.0
Recommended increment: 10.0
CenterCol (input_control) point.x → (real / integer)
圓弧中心的Column坐標。
Default value: 100.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0
Typical range of values: 0.0 ≤ CenterCol ≤ 511.0 (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Radius (input_control) number → (real / integer)
弧的半徑。
Default value: 50.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0
Typical range of values: 0.0 ≤ Radius ≤ 511.0 (lin)
Minimum increment: 1.0
Recommended increment: 10.0
AngleStart (input_control) angle.rad → (real / integer)
圓弧的開始角度,按弧度表示。
Default value: 0.0
Suggested values: -3.14159, -2.35619, -1.57080, -0.78540, 0.0, 0.78540, 1.57080, 2.35619, 3.14159
Typical range of values: -3.14159 ≤ AngleStart ≤ 3.14159 (lin)
Minimum increment: 0.03142
Recommended increment: 0.31416
AngleExtent (input_control) angle.rad → (real / integer)
圓弧的角度范圍,以弧度表示。
Default value: 6.28318
Suggested values: -6.28318, -5.49779, -4.71239, -3.92699, -3.14159, -2.35619, -1.57080, -0.78540, 0.78540, 1.57080, 2.35619, 3.14159, 3.92699, 4.71239, 5.49779, 6.28318
Typical range of values: -6.28318 ≤ AngleExtent ≤ 6.28318 (lin)
Minimum increment: 0.03142
Recommended increment: 0.31416
Restriction: AngleExtent != 0.0
AnnulusRadius (input_control) number → (real / integer)
環的半徑(半寬)。
Default value: 10.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0
Typical range of values: 0.0 ≤ AnnulusRadius ≤ 511.0 (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: AnnulusRadius <= Radius
Width (input_control) extent.x → (integer)
要處理的圖像的寬度。
Default value: 512
Suggested values: 128, 160, 192, 256, 320, 384, 512, 640, 768
Typical range of values: 0 ≤ Width ≤ 1024 (lin)
Minimum increment: 1
Recommended increment: 16
Height (input_control) extent.y → (integer)
要處理的圖像的高度。
Default value: 512
Suggested values: 120, 128, 144, 240, 256, 288, 480, 512, 576
Typical range of values: 0 ≤ Height ≤ 1024 (lin)
Minimum increment: 1
Recommended increment: 16
Interpolation (input_control) string → (string)
要使用的插值類型。
Default value: ‘nearest_neighbor’
List of values: ‘bicubic’, ‘bilinear’, ‘nearest_neighbor’
MeasureHandle (output_control) measure_id → (integer)
Measure對象的句柄
06. 結果
如果參數值正確,則運算符gen_measure_arc返回2(H_MSG_TRUE)。 否則會引發異常。
HDevelop例程
measure_ring.hdev 用圓形measure對象確定齒輪的寬度
measure_arc.hdev 測量沿著圓弧的金屬部件的寬度
gen_measure_arc.hdev 測量垂直于給定弧的邊
程序示例
07. 附錄
7.1 機器視覺博客匯總
網址:https://dengjin.blog.csdn.net/article/details/116837497
總結
以上是生活随笔為你收集整理的【机器视觉】 gen_measure_arc算子的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【机器视觉】 fuzzy_measure
- 下一篇: 【机器视觉】 gen_measure_r