- Code: Select all
BlobCounterBase bc = new BlobCounter();
// set filtering options
bc.FilterBlobs = true;
bc.MinWidth = 5;
bc.MinHeight = 5;
// set ordering options
bc.ObjectsOrder = ObjectsOrder.Size;
// process binary image
bc.ProcessImage(image);
Blob[] blobs = bc.GetObjectsInformation();
// extract the biggest blob
if (blobs.Length > 0)
{
bc.ExtractBlobsImage(image, blobs[0], true);
pictureBox2.Image = image;