BlobCounterBaseGetObjectsInformation Method |
Namespace: Accord.Imaging
Exception | Condition |
---|---|
ApplicationException | No 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); } }