Get objects' information.

Namespace:  AForge.Imaging
Assembly:  AForge.Imaging (in AForge.Imaging.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
public Blob[] GetObjectsInformation()

Return Value

Returns array of partially initialized blobs (without Image property initialized).

Remarks

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.

Examples

CopyC#
// 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 );
    }
}

Exceptions

ExceptionCondition
System..::.ApplicationExceptionNo image was processed before, so objects' information can not be collected.

See Also