Click or drag to resize
Accord.NET (logo)

BlobCounterBase Class

Base class for different blob counting algorithms.
Inheritance Hierarchy
SystemObject
  Accord.ImagingBlobCounterBase
    Accord.ImagingBlobCounter
    Accord.ImagingRecursiveBlobCounter

Namespace:  Accord.Imaging
Assembly:  Accord.Imaging (in Accord.Imaging.dll) Version: 3.7.0
Syntax
public abstract class BlobCounterBase : IDisposable
Request Example View Source

The BlobCounterBase type exposes the following members.

Constructors
  NameDescription
Protected methodBlobCounterBase
Initializes a new instance of the BlobCounterBase class.
Protected methodBlobCounterBase(Bitmap)
Initializes a new instance of the BlobCounterBase class.
Protected methodBlobCounterBase(BitmapData)
Initializes a new instance of the BlobCounterBase class.
Protected methodBlobCounterBase(UnmanagedImage)
Initializes a new instance of the BlobCounterBase class.
Top
Properties
  NameDescription
Public propertyBlobsFilter
Custom blobs' filter to use.
Public propertyCoupledSizeFiltering
Specifies if size filtering should be coupled or not.
Public propertyFilterBlobs
Specifies if blobs should be filtered.
Protected propertyImageHeight
Gets the height of the image.
Protected propertyImageWidth
Gets the width of the image.
Public propertyMaxHeight
Maximum allowed height of blob.
Public propertyMaxWidth
Maximum allowed width of blob.
Public propertyMinHeight
Minimum allowed height of blob.
Public propertyMinWidth
Minimum allowed width of blob.
Public propertyObjectLabels
Objects' labels.
Public propertyObjectsCount
Objects count.
Public propertyObjectsOrder
Objects sort order.
Top
Methods
  NameDescription
Protected methodBuildObjectsMap
Actual objects map building.
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExtractBlobsImage(Bitmap, Blob, Boolean)
Extract blob's image.
Public methodExtractBlobsImage(UnmanagedImage, Blob, Boolean)
Extract blob's image.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetBlobsEdgePoints
Get list of object's edge points.
Public methodGetBlobsLeftAndRightEdges
Get list of points on the left and right edges of the blob.
Public methodGetBlobsTopAndBottomEdges
Get list of points on the top and bottom edges of the blob.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetObjects(Bitmap, Boolean)
Get blobs.
Public methodGetObjects(UnmanagedImage, Boolean)
Get blobs.
Public methodCode exampleGetObjectsInformation
Get objects' information.
Public methodGetObjectsRectangles
Get objects' rectangles.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodProcessImage(Bitmap)
Build objects map.
Public methodProcessImage(BitmapData)
Build objects map.
Public methodProcessImage(UnmanagedImage)
Build object map from raw image data.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodIsEqual
Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.)
Public Extension MethodToT
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Top
Remarks

The class is abstract and serves as a base for different blob counting algorithms. Classes, which inherit from this base class, require to implement BuildObjectsMap(UnmanagedImage) method, which does actual building of object's label's map.

For blobs' searcing usually all inherited classes accept binary images, which are actually grayscale thresholded images. But the exact supported format should be checked in particular class, inheriting from the base class. For blobs' extraction the class supports grayscale (8 bpp indexed) and color images (24 and 32 bpp).

Sample usage:

// create an instance of a blob counter algorithm
BlobCounterBase bc = new BlobCounter();

// set filtering options
bc.FilterBlobs = true;
bc.MinWidth  = 5;
bc.MinHeight = 5;

// process binary image
bc.ProcessImage(image);

// process blobs
foreach (Blob blob in bc.GetObjects(image, false))
{
    // ...
    // blob.Rectangle - blob's rectangle
    // blob.Image - blob's image
}
See Also