Click or drag to resize
Accord.NET (logo)

BlobCounterBaseGetObjectsInformation Method

Get objects' information.

Namespace:  Accord.Imaging
Assembly:  Accord.Imaging (in Accord.Imaging.dll) Version: 3.8.0
public Blob[] GetObjectsInformation()
Request Example View Source

Return Value

Type: Blob
Returns array of partially initialized blobs (without Image property initialized).
ApplicationExceptionNo image was processed before, so objects' information can not be collected.

By the amount of provided information, the method is between GetObjectsRectangles and GetObjects(UnmanagedImage, Boolean) methods. The method provides array of blobs without initialized their image. Blob's image may be extracted later using ExtractBlobsImage(Bitmap, Blob, Boolean) or ExtractBlobsImage(UnmanagedImage, Blob, Boolean) method.

// create blob counter and process image
BlobCounter bc = new BlobCounter(sourceImage);

// specify sort order
bc.ObjectsOrder = ObjectsOrder.Size;

// get objects' information (blobs without image)
Blob[] blobs = bc.GetObjectInformation();

// process blobs
foreach (Blob blob in blobs)
    // check blob's properties
    if (blob.Rectangle.Width > 50)
        // the blob looks interesting, let's extract it
        bc.ExtractBlobsImage(sourceImage, blob);
See Also