Mimas Hough Transform

From MMVLWiki
(Difference between revisions)
Jump to: navigation, search
m
m
 
Line 8: Line 8:
  
 
Create a mm hough transform using a command such as:
 
Create a mm hough transform using a command such as:
mm_hough_transform    ht = new mm_hough_transform ();
+
mm_hough_transform    ht = new mm_hough_transform ();
  
 
This creates an image which has a double value for each pixel. Initialise it to the size you want:
 
This creates an image which has a double value for each pixel. Initialise it to the size you want:
  
ht.init(500,500);
+
ht.init(500,500);
  
 
Now, the object is to fill this image (2d array) with transformed results from some measurement system. For example, imaging that we are measuring lines and we can measure the gradient (which has a value -inf to  inf) and the intercept which has value 0-500. We could map the gradient to the x axis of the hough using:
 
Now, the object is to fill this image (2d array) with transformed results from some measurement system. For example, imaging that we are measuring lines and we can measure the gradient (which has a value -inf to  inf) and the intercept which has value 0-500. We could map the gradient to the x axis of the hough using:
  
x = arctan( gradient )  90 / 180 * 500
+
x = arctan( gradient )  90 / 180 * 500
  
 
and the y axis could be the intercept directly. These functions are really the transform part of the hough transform.
 
and the y axis could be the intercept directly. These functions are really the transform part of the hough transform.
Line 22: Line 22:
 
Make an entry into the Hough Transform like this:
 
Make an entry into the Hough Transform like this:
  
ht.addGaussPoint( x, y );
+
ht.addGaussPoint( x, y );
  
 
This adds a blurry point to the hough image. It will be added to any values already in the image. If you want to add a whole line of points, use
 
This adds a blurry point to the hough image. It will be added to any values already in the image. If you want to add a whole line of points, use
  
ht.addGaussLine( ... );
+
ht.addGaussLine( ... );
  
 
The blurriness of each point should be related to the size of the errors present in the measurement of the line gradient and intercept. Really it represents the probability of having measured values values of gradient and intercept.
 
The blurriness of each point should be related to the size of the errors present in the measurement of the line gradient and intercept. Really it represents the probability of having measured values values of gradient and intercept.
Line 34: Line 34:
 
If you want to view your hough, because it is just an image, do this:
 
If you want to view your hough, because it is just an image, do this:
  
ht.scale( 0,255 );
+
ht.scale( 0,255 );
ht.display();
+
ht.display();
  
 
There should be a routine in hough_transform to find the peaks in your hough but i haven't put it in yet !!
 
There should be a routine in hough_transform to find the peaks in your hough but i haven't put it in yet !!
Line 43: Line 43:
 
If you want particularly fast hough transforms (meaning that you want to put a lot of entries in ) then you have to firstly initalise a temp array :
 
If you want particularly fast hough transforms (meaning that you want to put a lot of entries in ) then you have to firstly initalise a temp array :
  
ht.initFastGauss( sigma, precision );
+
ht.initFastGauss( sigma, precision );
//sigma and precision determine the size of the blobs added to the hough for each
+
//sigma and precision determine the size of the blobs added to the hough for each
//point
+
//point
  
 
and then use
 
and then use
  
ht.addGaussPointFast(...);  
+
ht.addGaussPointFast(...);  
 
to add the points.  
 
to add the points.  
  
 
We use Hough Transforms in mimas as representations of features (eg cgh, pgh). This is because we can transform lines and corners , treating them as measurements and then create a Hough Transform which is essentially shows what has probably been measured given the input images. This means we can then compare Houghs using standard statistical methods such as the Bhattacharyya distance metric.  
 
We use Hough Transforms in mimas as representations of features (eg cgh, pgh). This is because we can transform lines and corners , treating them as measurements and then create a Hough Transform which is essentially shows what has probably been measured given the input images. This means we can then compare Houghs using standard statistical methods such as the Bhattacharyya distance metric.  
  
Some web pages on the Hough transform:
+
=External Links=
 
* http://www.anc.ed.ac.uk/~amos/hough.html
 
* http://www.anc.ed.ac.uk/~amos/hough.html
 
* http://rkb.home.cern.ch/rkb/AN16pp/node122.html
 
* http://rkb.home.cern.ch/rkb/AN16pp/node122.html

Latest revision as of 15:30, 15 March 2009

MMHoughTransform is a tool for producing and using hough transforms. As background:

The Hough Transform is a method invented and patented by PVC Hough back in the mists of time. It was originally used to locate particle trails in particle physics experiments. It is essentially a method for mapping measurements to a histogram space, so as to highlight features in the data. It also enables statistical properties to be accumulated.

The MM Hough Transform tool in Mimas is a misnomer . It is really a histogram tool. The transform is really used in user programs to fill the histogram.

Create a mm hough transform using a command such as:

mm_hough_transform    ht = new mm_hough_transform ();

This creates an image which has a double value for each pixel. Initialise it to the size you want:

ht.init(500,500);

Now, the object is to fill this image (2d array) with transformed results from some measurement system. For example, imaging that we are measuring lines and we can measure the gradient (which has a value -inf to inf) and the intercept which has value 0-500. We could map the gradient to the x axis of the hough using:

x = arctan( gradient )   90 / 180 * 500

and the y axis could be the intercept directly. These functions are really the transform part of the hough transform.

Make an entry into the Hough Transform like this:

ht.addGaussPoint( x, y );

This adds a blurry point to the hough image. It will be added to any values already in the image. If you want to add a whole line of points, use

ht.addGaussLine( ... );

The blurriness of each point should be related to the size of the errors present in the measurement of the line gradient and intercept. Really it represents the probability of having measured values values of gradient and intercept.

Typically you make many entries into the hough transform like this. Then you look for the maximum values (peaks) in the image and this tells you the robust measure gradients and intercepts for your data.

If you want to view your hough, because it is just an image, do this:

ht.scale( 0,255 );
ht.display();

There should be a routine in hough_transform to find the peaks in your hough but i haven't put it in yet !!

That is really almost all there is to hough transforms. They are just fancy images, used for collating measurements.

If you want particularly fast hough transforms (meaning that you want to put a lot of entries in ) then you have to firstly initalise a temp array :

ht.initFastGauss( sigma, precision );
//sigma and precision determine the size of the blobs added to the hough for each
//point

and then use

ht.addGaussPointFast(...); 

to add the points.

We use Hough Transforms in mimas as representations of features (eg cgh, pgh). This is because we can transform lines and corners , treating them as measurements and then create a Hough Transform which is essentially shows what has probably been measured given the input images. This means we can then compare Houghs using standard statistical methods such as the Bhattacharyya distance metric.

[edit] External Links

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox