Extract and Analyze Contours
Contour analysis involves three steps. First, curves are extracted from the image. Next, the curves are connected based on the connection parameters. Finally, the step selects a single connected curve to represent the contour. Refer to the NI Vision Concepts Help for more information about the process of contour analysis.
Main Tab
In the Step Name textbox, enter a descriptive name for the step.
Verify that the Reposition Region of Interest option is enabled if you want to link the region of interest specified in this step to a previously defined coordinate system.
Link the region of interest to a coordinate system if the position of the object under inspection changes from image to image, and you need to adjust the position of the region of interest to match the new location of the object.
Draw a ROI around an object in the image with contours that you want to analyze.
Extract Contour
Modify the Curve Extraction controls to improve curve detection, if necessary.
Modify the Contour Selection controls, if necessary, so that the step selects the correct contour for your application.
Modify the Curve End Point Connection controls, if necessary, to change how the step connects individual curves to produce contours.
Modify the Distance Range control to only connect curves with end points separated by a distance within the specified range. The following figure illustrates distance between end points: distance between end points
Distance
Modify the Angle Range control to only connect curves when the difference between the angle of the curves, measured at the end points, is within the specified range. Values range from 0 degrees to 180 degrees. The following figures illustrate how the angle of a curve is calculated: distance between end points distance between end points
A B
In Figure A, the difference between angle A and angle B is close to 0. In Figure B, the difference between angle A and angle C is close to 90 degrees.
Modify the Connectivity Range control to only connect curves when a line extended from the end point of one curve passes the end point of another curve within the specified distance. The following figure illustrates how connectivity is calculated: distance between end points
Distance between end point A and a
line extended from end point B
Distance between end point A and end
point C
End point A is closer to end point C than to end point B. Specify a connectivity range to connect end point A to end point B instead of end point C.
Modify the Gradient Direction Range control to only connect curves when the difference between the gradient angle of each curve is within the specified range. The following figure illustrates two curves with opposite gradient angles:
gradient difference between curves
Specify a high gradient range to connect the curves.
Note The Contour Selected indicator displays the color used to indicate the selected contour in the image.
Analyze Curvature
Enable the Compute Curvature checkbox if you want to compute the curvature of the selected contour. Adjust the Kernel Size value to change the size of the kernel used to compute the curvature profile of the contour. The Curvature Profile table displays the curvature profile for the selected contour. Refer to the NI Vision Concepts Help for more information about how the contour analysis algorithm computes curvature.
Complete the following steps if you want to classify individual curves along the selected contour:
Click the add range Add Range button to create a new curvature range.
Refer to the Curvature Profile and identify the curvature range that you want to classify. Tip A red line indicates the currently selected position in the curvature profile. A cross indicates the currently selected position on the selected contour in the displayed image. Use these indicators to identify the curvature range that you want to classify.
Adjust the Min and Max values to include the curvature range that you want to classify.
Click the Color for the selected curvature range to change the color used to indicate the class in the image.
Compare Contours
Enable the Compare Contour checkbox if you want to compare the selected contour to a fitted contour or a template contour.
Select To Fitted Contour to compare the selected contour to a fitted contour.
Select Line, Circle, or Ellipse to fit an ideally shaped contour to data points in the selected contour. Modify the Pixel Radius to control how the contour is fitted to the selected contour. Tip The step uses the following process to fit a contour. The step assumes that a point is part of the fitted contour if the point lies within a user-defined pixel radius from the fitted contour. Then the step fits a line to a subset of points that best describe the selected shape.
Select B-Spline or Polynomial to fit a contour to data points in the selected contour. Modify the Control Points
提取和分析輪廓輪廓的分析包括三個步驟。首先,從圖像中提取曲線。下一步,曲線連接基於連接參數。最後,步驟選擇單一的連接的曲線來表示輪廓。請參考 NI 視覺概念説明輪廓分析有關進程的詳細資訊。主選項卡在步驟名稱文字方塊中,輸入該步驟的描述性名稱。驗證重定的感興趣區域選項啟用了是否你想要連結到以前定義的座標系統此步驟中指定的感興趣區域。連結到一個座標系統的感興趣區域,如果被檢查物件的位置發生變化的圖像,並且您需要調整該地區的利益,以匹配該物件的新位置的位置。在與你想要分析的輪廓圖像繪製物件周圍的 ROI。提取輪廓如有必要,請修改曲線的提取控制項來改善曲線檢測。修改輪廓選擇控制項,如果有必要,以便步驟選擇正確的輪廓,為您的應用程式。修改曲線終點連接控制項,如果有必要,更改步驟如何連接單個曲線產生輪廓。修改要只連接曲線與相隔一定距離內的指定範圍的結束點的距離範圍控制項。下圖說明瞭結束點之間的距離︰ 結束點之間的距離Distance Modify the Angle Range control to only connect curves when the difference between the angle of the curves, measured at the end points, is within the specified range. Values range from 0 degrees to 180 degrees. The following figures illustrate how the angle of a curve is calculated: distance between end points distance between end points A B In Figure A, the difference between angle A and angle B is close to 0. In Figure B, the difference between angle A and angle C is close to 90 degrees.Modify the Connectivity Range control to only connect curves when a line extended from the end point of one curve passes the end point of another curve within the specified distance. The following figure illustrates how connectivity is calculated: distance between end points Distance between end point A and aline extended from end point B Distance between end point A and endpoint C End point A is closer to end point C than to end point B. Specify a connectivity range to connect end point A to end point B instead of end point C.Modify the Gradient Direction Range control to only connect curves when the difference between the gradient angle of each curve is within the specified range. The following figure illustrates two curves with opposite gradient angles: gradient difference between curvesSpecify a high gradient range to connect the curves. Note The Contour Selected indicator displays the color used to indicate the selected contour in the image. 分析曲率啟用計算曲率核取方塊,如果你想要計算所選輪廓線的曲率。調整要更改的內核用於計算的曲率輪廓的配置檔案大小的內核大小值。曲率設定檔表顯示所選輪廓線的曲率設定檔。請參考 NI 視覺概念説明關於如何輪廓分析演算法計算曲率的詳細資訊。如果你想要分類個人沿著選定的輪廓曲線,請完成以下步驟︰按一下添加範圍添加範圍按鈕創建新的曲率範圍。找出你想要分類的曲率範圍及曲率設定檔,請參閱。一條紅線指示曲率設定檔中的當前選定的位置的提示。跨指示選定輪廓上所顯示的圖像中的當前所選的位置。使用這些指標來確定你想要分類的曲率範圍。調整要包括你想要分類的曲率範圍的 Min 和 Max 的值。按一下所選的曲率範圍更改用來指示的類在圖像中的顏色的顏色。比較輪廓如果你想要比較所選的輪廓擬合的輪廓或範本輪廓,使比較輪廓核取方塊。選擇到擬合輪廓比較選定的輪廓擬合的輪廓。Select Line, Circle, or Ellipse to fit an ideally shaped contour to data points in the selected contour. Modify the Pixel Radius to control how the contour is fitted to the selected contour. Tip The step uses the following process to fit a contour. The step assumes that a point is part of the fitted contour if the point lies within a user-defined pixel radius from the fitted contour. Then the step fits a line to a subset of points that best describe the selected shape. Select B-Spline or Polynomial to fit a contour to data points in the selected contour. Modify the Control Points
正在翻譯中..
