NumberFound結果
套用至
視覺物件:ArcFinder, ArcInspector, Blob, CodeReader, ColorMatch, Contour, Correlation, Coordinates, DefectFinder, Edge, Geometric, Line, LineFinder, LineInspector, OCR, Point, Polar
說明
傳回在單一搜尋視窗內找到的特徵數量。
用途
VGet Sequence.Object.NumberFound, var
- Sequence
- 序列名稱或表示序列名稱的字串變數
- Object
- 物件名稱或表示物件名稱的字串變數。物件必須存在於指定序列中。
- var
- 表示結果值的整數變數
數值
所有物件的有效數字為0 - NumberToFind屬性值。
詳細說明
Blob、Correlation、Edge及Geometric物件支援在單一搜尋視窗內尋找多項特徵。NumberToFind屬性定義要尋找的特徵數量。
NumberFound結果會傳回實際上找到的特徵數量。
NumberFound為特殊結果,它會無視CurrentResult屬性的設定,永遠都會傳回為指定視覺物件找到的特徵編號。結果清單會顯示CurrentResult屬性選擇的結果。
Blob結果會依照已找到Blob的大小,由大至小排序。(即結果記錄1(CurrentResult = 1)含有最大的Blob結果。)
Correlation結果會依照Score結果的高低,由高至低排序。(即結果記錄1(CurrentResult = 1)含有具最高分數的特徵結果。)
偵測順序可透過Sort屬性設定變更。
參考
ArcFinder物件、ArcInspector物件、Blob物件、ColorMatc物件、Contour 物件、Correlation物件、CurrentResult屬性、DefectFinder物件、Edge物件、Found結果、Geometric物件、Line物件、LineFinder物件、LineInspector物件、NumberToFind屬性、Sort屬性、CodeReader物件、OCR物件、Point物件、Polar物件、Coordinates物件
範例
下列SPEL+語言範例執行mtest視覺序列,該序列包含名為Corr01的Correlation物件。Corr01已定義為尋找多項特徵(3)。下列程式將會執行序列,並確保為Corr01找到正確的特徵數量(3),然後以遞減順序印出Score結果。
Function main
# define NUM_TO_FIND 3
Boolean numfound
Integer score
VRun mtest
VGet mtest.Corr01.NumberFound, numfound
If numfound = NUM_TO_FIND Then
Print "The Proper Number of features(3) were found"
Else
Print "Only (", numfound, ") features were found"
Exit Function
EndIf
VGet mtest.Corr01.Score(1), score
Print "1st feature score (Best):", score
VGet mtest.Corr01.Score(2), score
Print "2nd feature score (Medium):", score
VGet mtest.Corr01.Score(3), score
Print "3rd feature score (Worst):", score
Fend