Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::transforms::CircularHough< T, U > Class Template Reference

#include <Hough.h>

Inheritance diagram for prapi::transforms::CircularHough< T, U >:

prapi::ImageTransform< T, U > List of all members.

Detailed Description

template<class T, class U>
class prapi::transforms::CircularHough< T, U >

Circular Hough transform.

The circular Hough transform detects circles in images. Circles are parametrized with their center pixel (R,C) and radius (r), resulting in a three-dimensional transform domain. The transformation method however returns a two-dimensional matrix. The third dimension is "virtualized" by copying two-dimensional domains on top of each other as shown in the following example:

 Two-dimensional transform domain:

     +------> C

 Three-dimensional domain:

     +------> C
 r=1 |
 r=N |

The circular Hough transform takes two forms. In the default form, input images are represented as gradient magnitude (edge) images. The transformation cannot be guided by gradient direction, which results in inaccurate and somewhat slow operation. If the U template parameter is of type Point<double>, each pixel in the image is treated as a gradient angle-magnitude pair. This kind of images can be obtained for example from DifferentialEdgeDetector. Given the gradient information, the transform can be optimized quite a lot.

Public Methods

 CircularHough (T magnitudeThreshold, int startRadius=1, int endRadius=-1, double radiusStep=1)
 Create an instance of the circular Hough transform.

void setThreshold (T threshold)
 Set the threshold.

getThreshold () const
 Get the current threshold.

void setRadii (int start, int end, double step)
 Set the radii that the transform looks for, and the sampling step.

int getStartRadius ()
 Get the start radius.

int getEndRadius ()
 Get the end radius.

double getRadiusStep ()
 Get the sampling step.

util::Matrix< T > getTransformedImage (const util::Matrix< U > &mat) throw (ImageTransformException&)
 Transform a gradient image.

Constructor & Destructor Documentation

template<class T, class U>
prapi::transforms::CircularHough< T, U >::CircularHough   magnitudeThreshold,
int    startRadius = 1,
int    endRadius = -1,
double    radiusStep = 1

Create an instance of the circular Hough transform.

The transform detects circles with a number of different radii, specified with the start/endRadius parameters and radiusStep. The total number of 2-D transformation domains stacked on each other is (endRadius - startRadius)/radiusStep.

magnitudeThreshold  in transformation, use only pixels with gradient magnitudes not less than this value.
startRadius  find circles with radii not smaller than this value
endRadius  find circles with radii not larger than this value. If endRadius is set to a number less than 1, all circles up to the largest possible one are found.
radiusStep  create a new 2-D transformation domain for each this many pixels.

The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.