RecursiveBlobCounter Class |
Namespace: Accord.Imaging
The RecursiveBlobCounter type exposes the following members.
Name | Description | |
---|---|---|
RecursiveBlobCounter |
Initializes a new instance of the RecursiveBlobCounter class.
| |
RecursiveBlobCounter(Bitmap) |
Initializes a new instance of the RecursiveBlobCounter class.
| |
RecursiveBlobCounter(BitmapData) |
Initializes a new instance of the RecursiveBlobCounter class.
| |
RecursiveBlobCounter(UnmanagedImage) |
Initializes a new instance of the RecursiveBlobCounter class.
|
Name | Description | |
---|---|---|
BackgroundThreshold |
Background threshold's value.
| |
BlobsFilter |
Custom blobs' filter to use.
(Inherited from BlobCounterBase.) | |
CoupledSizeFiltering |
Specifies if size filtering should be coupled or not.
(Inherited from BlobCounterBase.) | |
FilterBlobs |
Specifies if blobs should be filtered.
(Inherited from BlobCounterBase.) | |
ImageHeight |
Gets the height of the image.
(Inherited from BlobCounterBase.) | |
ImageWidth |
Gets the width of the image.
(Inherited from BlobCounterBase.) | |
MaxHeight |
Maximum allowed height of blob.
(Inherited from BlobCounterBase.) | |
MaxWidth |
Maximum allowed width of blob.
(Inherited from BlobCounterBase.) | |
MinHeight |
Minimum allowed height of blob.
(Inherited from BlobCounterBase.) | |
MinWidth |
Minimum allowed width of blob.
(Inherited from BlobCounterBase.) | |
ObjectLabels |
Objects' labels.
(Inherited from BlobCounterBase.) | |
ObjectsCount |
Objects count.
(Inherited from BlobCounterBase.) | |
ObjectsOrder |
Objects sort order.
(Inherited from BlobCounterBase.) |
Name | Description | |
---|---|---|
BuildObjectsMap |
Actual objects map building.
(Overrides BlobCounterBaseBuildObjectsMap(UnmanagedImage).) | |
Dispose |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from BlobCounterBase.) | |
Dispose(Boolean) |
Releases unmanaged and - optionally - managed resources.
(Inherited from BlobCounterBase.) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
ExtractBlobsImage(Bitmap, Blob, Boolean) |
Extract blob's image.
(Inherited from BlobCounterBase.) | |
ExtractBlobsImage(UnmanagedImage, Blob, Boolean) |
Extract blob's image.
(Inherited from BlobCounterBase.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetBlobsEdgePoints |
Get list of object's edge points.
(Inherited from BlobCounterBase.) | |
GetBlobsLeftAndRightEdges |
Get list of points on the left and right edges of the blob.
(Inherited from BlobCounterBase.) | |
GetBlobsTopAndBottomEdges |
Get list of points on the top and bottom edges of the blob.
(Inherited from BlobCounterBase.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetObjects(Bitmap, Boolean) |
Get blobs.
(Inherited from BlobCounterBase.) | |
GetObjects(UnmanagedImage, Boolean) |
Get blobs.
(Inherited from BlobCounterBase.) | |
GetObjectsInformation |
Get objects' information.
(Inherited from BlobCounterBase.) | |
GetObjectsRectangles |
Get objects' rectangles.
(Inherited from BlobCounterBase.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ProcessImage(Bitmap) |
Build objects map.
(Inherited from BlobCounterBase.) | |
ProcessImage(BitmapData) |
Build objects map.
(Inherited from BlobCounterBase.) | |
ProcessImage(UnmanagedImage) |
Build object map from raw image data.
(Inherited from BlobCounterBase.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(Type) | Overloaded.
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.) | |
ToT | Overloaded.
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.) |
The class counts and extracts stand alone objects in images using recursive version of connected components labeling algorithm.
Note |
---|
The algorithm treats all pixels with values less or equal to BackgroundThreshold as background, but pixels with higher values are treated as objects' pixels. |
Note |
---|
Since this algorithm is based on recursion, it is required to be careful with its application to big images with big blobs, because in this case recursion will require big stack size and may lead to stack overflow. The recursive version may be applied (and may be even faster than BlobCounter) to an image with small blobs - "star sky" image (or small cells, for example, etc). |
For blobs' searching the class supports 8 bpp indexed grayscale images and 24/32 bpp color images. See documentation about BlobCounterBase for information about which pixel formats are supported for extraction of blobs.
Sample usage:
// create an instance of blob counter algorithm var bc = new RecursiveBlobCounter(); // process binary image bc.ProcessImage(image); // process blobs foreach (Rectangle rect in bc.GetObjectsRectangles()) { // ... }