CogBlob MorphologyOperations Property Cognex VisionPro
A collection of CogBlobMorphologyConstants indicating which morphology operations are to be performed on the segmented image. The operations are performed in the order in which they are added to the collection. Operations can be added multiple times.

Namespace: Cognex.VisionPro.Blob
Assembly: Cognex.VisionPro.Blob (in Cognex.VisionPro.Blob.dll) Version: 65.1.0.0
Syntax

public CogBlobMorphologyCollection MorphologyOperations { get; set; }

Property Value

Type: CogBlobMorphologyCollection
The default is an empty collection.
Events

Event TypeReason
ICogChangedEvent Changed

Fires when the value of this property changes.

The following state flag may be affected:

Remarks

A collection of CogBlobMorphologyConstants indicating which morphology operations are to be performed on the segmented image. The operations are performed in the order in which they are added to the collection. Operations can be added multiple times.

Examples

Imports Cognex.VisionPro
Imports Cognex.VisionPro.Blob

Private Sub doBlob()
Dim myBlob As New CogBlob
Dim myBlobResults As CogBlobResults
Dim myImage As CogImage8Grey
myBlob.SaveSegmentedImage = True
myBlob.SaveSegmentedImageBeforeMorphology = True
myBlob.MorphologyOperations.Add(CogBlobMorphologyConstants.DilateSquare)
myBlob.MorphologyOperations.Add(CogBlobMorphologyConstants.OpenSquare)
myBlobResults = myBlob.Execute(mobjImage, r)
TextBox1.Text = myBlobResults.GetBlobs.Count
myImage = myBlobResults.CreateSegmentedImage(CogBlobSegmentedImageConstants.BeforeMorphology, True)
cdDisp.Image = myImage
MsgBox("next")
myImage = myBlobResults.CreateSegmentedImage(CogBlobSegmentedImageConstants.cogBlobSegmentedImage, True)
cdDisp.Image = myImage
End Sub
using Cognex.VisionPro; 
using Cognex.VisionPro.Blob;

   private void doBlob()
 {
 CogBlob myBlob=new CogBlob(); 
 CogBlobResults myBlobResults; 
 CogImage8Grey myImage; 
 myBlob.SaveSegmentedImage = true;
 myBlob.SaveSegmentedImageBeforeMorphology = true;
 myBlob.MorphologyOperations.Add(CogBlobMorphologyConstants.DilateSquare);
 myBlob.MorphologyOperations.Add(CogBlobMorphologyConstants.OpenSquare);
 myBlobResults = myBlob.Execute(mobjImage, r);
 textBox1.Text =  myBlobResults.GetBlobs(true).Count.ToString();
 myImage = myBlobResults.CreateSegmentedImage(CogBlobSegmentedImageConstants.BeforeMorphology, true);
 cdDisp.Image = myImage;
 MessageBox.Show("next");
 myImage = myBlobResults.CreateSegmentedImage(CogBlobSegmentedImageConstants.cogBlobSegmentedImage, true);
 cdDisp.Image = myImage;
 }
See Also