跳至內容
測試伺服器
開發伺服器

Line Measurements Pro vTool#

Line Measurements Pro vTool 可讓您測量影像中線段的位置、方向及長度。

Line Measurements Pro vTool 透過「影像」輸入針腳接收影像,並透過其輸出針腳輸出所偵測到的線條相關資訊。

若您在測量前使用「校準 vTool」,並將兩個 vTool的變換輸出/輸入接腳相互連接,則「校準 vTool」所提供的變換資料將使「Line Measurements Pro 」vTool 能以世界座標系中的公尺為單位輸出測量結果(後綴為_m的輸出接腳將可使用)。

如果您在測量前使用 Matching vTool 與 Image Alignment vTool,您可以測量出現在與參考影像不同位置的物件。透過 InverseTf 輸入接腳提供的轉換可讓 vTool 輸出原始輸入影像的測量結果。

如欲購買「Line Measurements Pro 」vTool 的授權,請造訪Basler 網站。該授權亦包含以下 vTool:

Line Measurements Pro vTool

運作原理#

透過定義量測物件並將其貼合至輸入影像中您想要量測的形狀,您可以收集下列資訊:

  • 具有形狀視覺化效果的區域
  • 該線的測量數據
  • 形狀貼合評分

形狀設定#

測量物件定義了 vTool 用於偵測待測量形狀邊緣的區域。載入影像後,系統會顯示一個預設的矩形測量物件。矩形短邊上的兩個點分別定義了線段的起點與終點。綠色箭頭則指示在樣本區段中計算邊緣輪廓的方向。

測量對象的高度等於形狀公差值的兩倍。輸入影像中待測的線段必須位於測量對象範圍內。若指定較大的公差值,即可容許目標形狀在厚度上的變化。

您可以透過拖曳矩形的控制點,或手動在相應的輸入框中輸入所需數值,或使用提供的滑桿,來移動、調整大小及旋轉測量物件。「形狀公差」的數值只能手動輸入。

樣本設定#

除了測量物件的大小和位置之外,您還可以指定取樣區段的數量和寬度。在此類取樣區段內,vTool 會偵測可能的邊緣候選項目,並將其擬合至幾何形狀。您使用的區段越多,測量結果就會越穩健。缺點是大量的區段會降低處理速度。

依預設,區段會均勻分佈且具有最小的間隙與重疊,並且 Number of sample segments 與 Sample segment width 選項會進行連結。如果您變更其中一個,另一個也會隨之調整。如果您停用此連結,則可以自由調整數量與寬度。在這種情況下唯一的限制就是測量物件的大小。

  • 已連結選項: 鏈結圖示
  • 未連結選項: 取消鏈結圖示

透過指定適當的 Sample tolerance 值,您可以考量潛在形狀變形的波浪狀或大小。取樣的邊緣點必須在此容差範圍內,才能支援形狀擬合。

透過 Minimum score 選項,您可以指定內點的預期比例,也就是說,有多少樣本必須支援形狀擬合。

偵測設定#

邊緣被定義為梯度絕對值局部最強的位置。通常,輪廓訊號會透過低通濾波器進行平滑化。使用 Smoothing 選項來設定濾波器的強度。

The local extrema of the gradient must be stronger than the Threshold value specified to be accepted as an edge. Try different threshold values to find the optimum setting. The optimum is somewhere between an upper value where all target edges are just detected and a lower value where unwanted edges are not detected anymore.

邊緣具有正梯度或負梯度。如果邊緣梯度為正,則轉變是從暗到亮。如果邊緣梯度為負,則轉變是從亮到暗。如果您預期應用程式只會找到一種類型的轉變,請相應地設定 Transition 選項。透過 Uniform 轉變選項,您可以確保僅選取相同轉變的邊緣。

結合轉變設定,Select 選項允許您指定要選擇哪些邊緣,以便將測量物件擬合至形狀。為了使應用程式更穩健,請僅選取所需的類型,而不是將選項設為 All。這可以是第一個、最後一個或最強的(就梯度大小而言)邊緣。

資訊

vTool 會讀取樣本區段在測量物件的綠色箭頭所指示方向上的灰度值曲線。

Using Calibration#

The resulting positions and distances can also be output in world coordinates in meters. To achieve this, connect the Transformation output pin of the Calibration vTool to the Measurements vTool's Transformation input pin.

資訊

The measurement plane is the plane in which the edges to be measured lie in the 3-dimensional world. In every image to process, the edges have different positions within the measurement plane. Register this measurement plane by placing the calibration plate's surface in this measurement plane.

You have to use the same calibration configuration for setting up the Measurements vTool as for the actual processing.

Using Image Alignment#

「Line Measurements Pro 」vTool 要求待測形狀必須始終保持在相同位置,也就是說,必須位於定義的形狀公差範圍內。否則,檢測將會失敗。為了提供您更大的靈活性,您可以將「Matching」vTool 和「Image Alignment 」vTool加入您的製程配方中。

配對功能能夠偵測輸入影像中與參考影像相比,位於不同位置的目標形狀。它會計算並輸出對齊變換資料,隨後「Image Alignment 」vTool 會利用這些資料,將已對齊的輸入影像傳送至「Line Measurements Pro 」vTool,此時該形狀在影像中的位置將與參考影像中的位置一致。此時,即可對該形狀進行測量。

Line Measurements Pro vTool 亦會接收逆變換資料,藉此可針對輸入影像(而非對齊後的影像)輸出正確的位置資料。

資訊

如果 InverseTf 輸入接腳未連接,則會相對於對齊後的影像輸出形狀的參數。
如果 InverseTf 輸入接腳已連接,則會相對於 Image Alignment vTool 的輸入影像輸出形狀的參數。
這適用於您是否使用 Calibration vTool 的情況。

設定 vTool#

要設定「Line Measurements Pro 」vTool:

Line Measurements Pro vTool 設定

  1. 在vTool「設定」區域的「配方管理」窗格中,按一下「開啟設定」或雙擊該 vTool。
    此時會開啟 Line Measurements Pro 對話方塊隨即開啟。
  2. 擷取或開啟影像。
  3. 在「形狀設定」區域中,請透過手動輸入數值來定義測量物件。
    此外,您也可以使用線條的控制點來移動、調整大小及旋轉該線條,使其與影像中您要測量的目標形狀吻合。
    水平測量物件的角度為 0。
  4. 在 Sample Settings 區域中,指定取樣區段的數量與寬度,以及取樣容差和所需的最低分數。
  5. 按一下 Show/Hide Details 按鈕以在影像中顯示取樣區段與取樣點。
  6. In the Detection Settings area, set Smoothing and Threshold to detect the edges in a robust and precise manner.
  7. Set Transition and Select such that only the target edges are selected.

You can view the result of the measurement in a pin data view. Here, you can select which outputs to display.

Inputs#

Image#

可直接從「相機」vTool 或任何能輸出影像的 vTool(例如「Image Format Converter 」vTool)接收影像。

  • 資料類型:圖片
  • 影像格式:8 位元至 16 位元單色或彩色影像。彩色影像會在內部轉換為單色影像。

InverseTf#

Accepts the inverse transformation data of the alignment transformation. With this, the vTool can output correct position data for the input image instead of the aligned image.

  • Data type: Transformation Data

Transformation#

接收來自 Calibration vTool 的轉換資料。

  • Data type: Transformation Data

Outputs#

Region#

傳回形狀的區域。

  • 資料類型:Region

Line_px#

以影像像素座標(列/欄)傳回形狀的測量結果。

  • 資料類型:線段

Line_m#

以公尺(x/y)為單位的世界座標傳回形狀的測量結果。

  • 資料類型:線段

Score#

傳回形狀擬合的分數。

  • 資料類型:Float

典型前置元件#