C# 클래스 AForge.Imaging.RecursiveBlobCounter

Blob counter based on recursion.

The class counts and extracts stand alone objects in images using recursive version of connected components labeling algorithm.

The algorithm treats all pixels with values less or equal to BackgroundThreshold as background, but pixels with higher values are treated as objects' pixels.

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 RecursiveBlobCounter bc = new RecursiveBlobCounter( ); // process binary image bc.ProcessImage( image ); Rectangle[] rects = bc.GetObjectsRectangles( ); // process blobs foreach ( Rectangle rect in rects ) { // ... }
상속: BlobCounterBase
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET

공개 메소드들

메소드 설명
RecursiveBlobCounter ( ) : System

Initializes a new instance of the RecursiveBlobCounter class.

Creates new instance of the RecursiveBlobCounter class with an empty objects map. Before using methods, which provide information about blobs or extract them, the BlobCounterBase.ProcessImage(Bitmap), BlobCounterBase.ProcessImage(BitmapData) or BlobCounterBase.ProcessImage(UnmanagedImage) method should be called to collect objects map.

RecursiveBlobCounter ( Bitmap image ) : System

Initializes a new instance of the RecursiveBlobCounter class.

RecursiveBlobCounter ( BitmapData imageData ) : System

Initializes a new instance of the RecursiveBlobCounter class.

RecursiveBlobCounter ( UnmanagedImage image ) : System

Initializes a new instance of the RecursiveBlobCounter class.

보호된 메소드들

메소드 설명
BuildObjectsMap ( UnmanagedImage image ) : void

Actual objects map building.

The method supports 8 bpp indexed grayscale images and 24/32 bpp color images.

비공개 메소드들

메소드 설명
LabelColorPixel ( byte pixel, int labelPointer ) : void
LabelPixel ( byte pixel, int labelPointer ) : void

메소드 상세

BuildObjectsMap() 보호된 메소드

Actual objects map building.
The method supports 8 bpp indexed grayscale images and 24/32 bpp color images.
Unsupported pixel format of the source image.
protected BuildObjectsMap ( UnmanagedImage image ) : void
image UnmanagedImage Unmanaged image to process.
리턴 void

RecursiveBlobCounter() 공개 메소드

Initializes a new instance of the RecursiveBlobCounter class.
Creates new instance of the RecursiveBlobCounter class with an empty objects map. Before using methods, which provide information about blobs or extract them, the BlobCounterBase.ProcessImage(Bitmap), BlobCounterBase.ProcessImage(BitmapData) or BlobCounterBase.ProcessImage(UnmanagedImage) method should be called to collect objects map.
public RecursiveBlobCounter ( ) : System
리턴 System

RecursiveBlobCounter() 공개 메소드

Initializes a new instance of the RecursiveBlobCounter class.
public RecursiveBlobCounter ( Bitmap image ) : System
image System.Drawing.Bitmap Image to look for objects in.
리턴 System

RecursiveBlobCounter() 공개 메소드

Initializes a new instance of the RecursiveBlobCounter class.
public RecursiveBlobCounter ( BitmapData imageData ) : System
imageData System.Drawing.Imaging.BitmapData Image data to look for objects in.
리턴 System

RecursiveBlobCounter() 공개 메소드

Initializes a new instance of the RecursiveBlobCounter class.
public RecursiveBlobCounter ( UnmanagedImage image ) : System
image UnmanagedImage Unmanaged image to look for objects in.
리턴 System