NumberFound Result

Applies To
Vision Objects: ArcFinder, ArcInspector, Blob, CodeReader, ColorMatch, Contour, Correlation, DefectFinder, Edge, Geometric, Line, LineFinder, LineInspector, OCR, Point, Polar, Coordinates

Description
Returns the number of features found within a single Search Window.

Usage

VGet  Sequence.Object.NumberFound, var
Sequence
Name of a sequence or string variable containing a sequence name.
Object
Name of an object or string variable containing an object name. The object must exist in the specified sequence.
var
Integer variable that will contain the value of the result.

Values
Valid number found for all objects is 0 to NumberToFind property value.

Remarks
Blob, Correlation, Edge, and Geometric objects support the finding of multiple features within a single Search Window. The NumberToFind property defines how many features to search for.

The NumberFound result returns how may features were actually found.

The NumberFound result is a special result. It always returns the number of features that were found for the specified vision object regardless of the setting of the CurrentResult property. The result list shows the results selected by the CurrentResult property.

Blob results are ordered by largest found blob to smallest found blob. (i.e. result record 1 (CurrentResult = 1) contains the results for the largest blob.)

Correlation results are ordered by highest Score result to lowest Score result. (i.e. result Record 1 (CurrentResult =1) contains the results for the feature with the highest score.)

The order of detection can be changed by the Sort property setting.

See Also
ArcFinder Object, ArcInspector Object, Blob Object, ColorMatch Object, Contour Object, Correlation Object, CurrentResult Property, DefectFinder Object, Edge Object, Found Result, Geometric Object, Line Object, LineFinder Object, LineInspector Object, NumberToFind Property, Sort Property, CodeReader Object, OCR Object, Point Object, Polar Object

Example
The following SPEL+ language example runs a vision sequence called mtest which contains a Correlation object called Corr01. Corr01 has been defined to find multiple features (3). The following program will run the sequence and make sure that the proper number of features (3) was found for Corr01 and then print the Score result in descending order.

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