C# Класс Accord.Imaging.HoughCircleTransformation

Hough circle transformation.

The class implements Hough circle transformation, which allows to detect circles of specified radius in an image.

The class accepts binary images for processing, which are represented by 8 bpp grayscale images. All black pixels (0 pixel's value) are treated as background, but pixels with different value are treated as circles' pixels.

Sample usage:

HoughCircleTransformation circleTransform = new HoughCircleTransformation( 35 ); // apply Hough circle transform circleTransform.ProcessImage( sourceImage ); Bitmap houghCirlceImage = circleTransform.ToBitmap( ); // get circles using relative intensity HoughCircle[] circles = circleTransform.GetCirclesByRelativeIntensity( 0.5 ); foreach ( HoughCircle circle in circles ) { // ... }

Initial image:

Hough circle transformation image:

Показать файл Открыть проект

Открытые методы

Метод Описание
GetCirclesByRelativeIntensity ( double minRelativeIntensity ) : Accord.Imaging.HoughCircle[]

Get circles with relative intensity higher then specified value.

GetMostIntensiveCircles ( int count ) : Accord.Imaging.HoughCircle[]

Get specified amount of circles with highest intensity.

HoughCircleTransformation ( int radiusToDetect ) : System

Initializes a new instance of the HoughCircleTransformation class.

ProcessImage ( Bitmap image ) : void

Process an image building Hough map.

ProcessImage ( BitmapData imageData ) : void

Process an image building Hough map.

ProcessImage ( UnmanagedImage image ) : void

Process an image building Hough map.

ToBitmap ( ) : Bitmap

Ñonvert Hough map to bitmap.

Приватные методы

Метод Описание
CollectCircles ( ) : void
DrawHoughCircle ( int xCenter, int yCenter ) : void
SetHoughCirclePoints ( int cx, int cy, int x, int y ) : void
SetHoughPoint ( int x, int y ) : void

Описание методов

GetCirclesByRelativeIntensity() публичный метод

Get circles with relative intensity higher then specified value.
public GetCirclesByRelativeIntensity ( double minRelativeIntensity ) : Accord.Imaging.HoughCircle[]
minRelativeIntensity double Minimum relative intesity of circles.
Результат Accord.Imaging.HoughCircle[]

GetMostIntensiveCircles() публичный метод

Get specified amount of circles with highest intensity.
public GetMostIntensiveCircles ( int count ) : Accord.Imaging.HoughCircle[]
count int Amount of circles to get.
Результат Accord.Imaging.HoughCircle[]

HoughCircleTransformation() публичный метод

Initializes a new instance of the HoughCircleTransformation class.
public HoughCircleTransformation ( int radiusToDetect ) : System
radiusToDetect int Circles' radius to detect.
Результат System

ProcessImage() публичный метод

Process an image building Hough map.
Unsupported pixel format of the source image.
public ProcessImage ( Bitmap image ) : void
image System.Drawing.Bitmap Source image to process.
Результат void

ProcessImage() публичный метод

Process an image building Hough map.
Unsupported pixel format of the source image.
public ProcessImage ( BitmapData imageData ) : void
imageData System.Drawing.Imaging.BitmapData Source image data to process.
Результат void

ProcessImage() публичный метод

Process an image building Hough map.
Unsupported pixel format of the source image.
public ProcessImage ( UnmanagedImage image ) : void
image UnmanagedImage Source unmanaged image to process.
Результат void

ToBitmap() публичный метод

Ñonvert Hough map to bitmap.
Hough transformation was not yet done by calling /// ProcessImage() method.
public ToBitmap ( ) : Bitmap
Результат System.Drawing.Bitmap