The blob measure that will be used for sorting the
filtered collection of blobs. SortMeasure is only used if SortEnabled
is true.
Namespace: Cognex.VisionPro.BlobAssembly: Cognex.VisionPro.Blob (in Cognex.VisionPro.Blob.dll) Version: 65.1.0.0
Syntax
Property Value
Type: CogBlobMeasureConstantsThe default is Area
Events
| Event Type | Reason |
|---|---|
| ICogChangedEvent Changed | Fires when the value of this property changes. The following state flag may be affected: |
Exceptions
| Exception | Condition |
|---|---|
| ArgumentException | The supplied value is not a member of CogBlobMeasureConstants |
Remarks
The blob measure that will be used for sorting the filtered collection of blobs. SortMeasure is only used if SortEnabled is true.
Examples
Imports Cognex.VisionPro
Imports Cognex.VisionPro.Blob
Private Sub doBlob()
Dim myBlob As New CogBlob
Dim myBlobResults As CogBlobResults
Dim smallestPerimeter As Double
Dim largestPerimeter As Double
myBlob.SortEnabled = True
myBlob.SortMeasure = CogBlobMeasureConstants.Perimeter
myBlob.SortAscending = False
myBlobResults = myBlob.Execute(mobjImage, r)
TextBox1.Text = myBlobResults.GetBlobs.Count
largestPerimeter = myBlobResults.GetBlobs.Item(0).Perimeter
smallestPerimeter = myBlobResults.GetBlobs.Item(myBlobResults.GetBlobs.Count - 1).Perimeter
MsgBox("Largest Perimeter: " + largestPerimeter + vbCr + " Smallest Perimeter: " + smallestPerimeter)
End Subusing Cognex.VisionPro; using Cognex.VisionPro.Blob; private void doBlob() { CogBlob myBlob=new CogBlob(); CogBlobResults myBlobResults; double smallestPerimeter; double largestPerimeter; myBlob.SortEnabled = true; myBlob.SortMeasure = CogBlobMeasureConstants.Perimeter; myBlob.SortAscending = false; myBlobResults = myBlob.Execute(mobjImage, r); textBox1.Text = myBlobResults.GetBlobs().Count.ToString(); largestPerimeter = myBlobResults.GetBlobs()[0].Perimeter; smallestPerimeter = myBlobResults.GetBlobs()[myBlobResults.GetBlobs().Count - 1].Perimeter; MessageBox.Show ("Largest Perimeter: " + largestPerimeter + " Smallest Perimeter: " + smallestPerimeter); }
See Also