Difference between revisions of "Hough Transform"

From MIPAV
Jump to: navigation, search
m (Background)
m
Line 1: Line 1:
 
This topic is a stub.
 
This topic is a stub.
For the HTML MIPAV help refer to [http://mipav.cit.nih.gov/documentation/HTML%20Algorithms/HoughTransform.html|HoughTransform.html ]
+
For the HTML MIPAV help refer to [http://mipav.cit.nih.gov/documentation/HTML%20Algorithms/HoughTransform.html|HoughTransform.html]
  
 
== Background ==
 
== Background ==

Revision as of 19:31, 6 August 2012

This topic is a stub. For the HTML MIPAV help refer to [1]

Background

The Hough transform is a technique which is used to determine and isolate features of a particular shape within an image. The classical Hough transform requires that the desired shapes be specified in some parametric form. It is most commonly used for the detection of simple curves such as lines, circles, and ellipses within a given image.


The Hough Transform uses (xi, yi) points in the original 2D image space to generate

  • (rho, theta) points in the Hough transform space for lines,
  • (x0, y0, radius) points in the Hough transform space for circles,
  • (p, q, r1, r2, theta) points in the Hough transform space for ellipses,
  • and (xv, yv, phi, p) points in the Hough transform space for parabolas.

Applying Hough transform to images

Running the Hough Transform for Line Filing algorithm

Running the Hough Transform for Line Filling algorithm

To run the algorithm, do the following:

  1. Run MIPAV.
  2. Open an image of interest. Make sure that the image has a binary type. You might consider processing the image, first, and then running the Hough Transform on the processed image. Processing may include applying Gradient Magnitude (GM), and then thresholding the GM result image to convert it to the binary image.
  3. Navigate to Algorithms > Hough Transform > Line Filling.
  4. In the Hough Transform for Line Filling dialog box that appears, enter the user defined values into X dimension and Y dimension text boxes. See Figure (a).
  5. Press OK. The algorithm begins to run and the progress bar appears with the status. When the algorithm finishes running, the Hough Transform image and the Hough Transform Line Selection dialog box appear, see Figure (b).
  6. In the Hough Transform Line Selection dialog box, use the check boxes to select lines and also specify the minimum gap distance.
  7. Press OK
  8. The result image appears displaying isolated lines. See Figure (c).

Running the Hough Transform for Circle Detection algorithm

Running the Hough Transform for Circle Detection algorithm. Note that only two of three isolated circles are shown in the result image, because only two were checked in the Hough Transform Circle Selection dialog box

To run the algorithm, do the following:

  1. Run MIPAV.
  2. Open an image of interest. Make sure that the image has a binary type. You might consider processing the image, first, and then running the Hough Transform on the processed image. Processing may include applying Gradient Magnitude (GM), and then thresholding the GM result image to convert it to the binary image.
  3. Navigate to Algorithms > Hough Transform >Circle Detection. The Hough Transform Circle Detection dialog box appears.
  4. In the Hough Transform Circle Detection dialog box, enter the values for x0, y0, rad and number of circles.
  5. Press OK. The algorithm begins to run and the progress bar appears with the status. When the algorithm finishes running, the Hough Transform Circle Selection dialog box appears displaying the number of circles found.
  6. The result image with circles appears. See the Figure on right.

Running the Hough Transform for Ellipse Detection algorithm

Running the Hough Transform for Ellipse Detection algorithm. Note that isolated ellipses checked for display appear in red

To run the algorithm, do the following

  1. Run MIPAV.
  2. Open an image of interest. Make sure that the image has a binary type. You might consider processing the image, first, and then running the Hough Transform on the processed image. Processing may include applying Gradient Magnitude (GM), and then thresholding the GM result image to convert it to the binary image.
  3. Navigate to Algorithms > Hough Transform > Ellipse Detection. The Hough Transform Ellipse Detection dialog box appears.
  4. Complete the Hough Transform Ellipse Detection dialog box. For the first run of the algorithm enter the number of ellipses, but use the default values for the other entries. Later, you can adjust the values based on the result you received.
  5. Press OK. The algorithm begins to run and the progress bar appears with the status. When the algorithm finishes running, the Hough Transform Ellipse Selection dialog box appears displaying the number of ellipses found. Also, the ellipse statistics appears in the Output tab. See the Figure on right.
  6. In the Hough Transform Ellipse Selection dialog box, use check boxes to specify which ellipses you would like to isolate in the image. Press OK.
  7. The result image appears displaying isolated ellipses in red. See the Figure on right.

Hough Transform for Ellipse Detection dialog box

Minimum percentage of ellipse perimeter with points - minimum percentage of the perimeter of a found ellipse that must be covered by points for it to be valid. The default value is 30.0.

Maximum curve points on each side for tangent - the maximum number of points to take from each side of a point on a curve in determining a tangent. If only one point is available on each side, the algorithm uses average of slopes to each of the neighboring points. By default, it is set to 3.

Desired maximum pixel difference for p, q, r1, or r2 value - the desired maximum pixel difference allowed for p, q, r1, and r2 values within a single bin. If sufficient memory is not available, the actual maximum pixel difference will be greater than the desired pixel difference. By default, it is set to 2.0.

Desired maximum degrees difference for theta value - the maximum degrees difference allowed for theta for five values to be placed into an existing bin. By default, it is set to 3.0. Minimum distance between 2 of 3 picked points - the smallest allowable distance between 2 of 3 picked points. By default, it is set to 3.0.

Maximum distance between 2 of 3 picked points - the largest allowable distance between 2 of 3 triplet points. The maximum distance would be the major axis distance of the largest possible ellipse. By default, it is set to 100.0.

Point triplets required for ellipse find - a number of point triplets acquired before each ellipse find is performed. By default, it is set to 1000.

Counts in a p, q, r1, r2 bin required for an ellipse find - the minimum number of counts that must be present in at least one bin for an ellipse find to occur. By default, it is set to 2.

Maximum percent deviation for perimeter pixels - the max percent, by which perimeter pixels can deviate from the ellipse equation. By default, it is set to 15.

Number of ellipses - a number of ellipses to be found.

Maximum number of ellipse find circles - the maximum number of times that the required number of point triplets will be acquired to find an ellipse. If 1,000 point triplets are required and the maximum number of ellipse find cycles is 80, then 1,000 point triplets can be acquired no more than 80 times. After 1,000 point triplets have been acquired, no ellipses may be detected either because no p, q, r1, r2, theta bin has the required minimum number of counts or because the minimum percentage of the perimeter is not covered. If failures occur because no bin has the required minimum number of counts, the maximum pixel difference and/or maximum degree difference could be increased to create fewer bins with smaller resolution but larger counts.

Maximum Hough transform in megabytes- the maximum allowed size in memory used for Hough transform. As the memory size grows, the pixel and degree width for each bin can decrease. By default, it is set to 256 MB.

Running the Hough Transform for Parabola Detection algorithm

Running the Hough Transform for Parabola Detection algorithm. Note that the detected parabola appears in red

To run the algorithm, do the following:

  1. Run MIPAV.
  2. Open an image of interest. Make sure that the image has a binary type. You might consider processing the image, first, and then running the Hough Transform on the processed image. Processing may include applying Gradient Magnitude (GM), and then thresholding the GM result image to convert it to the binary image.
  3. Navigate to Algorithms > Hough Transform > Parabola Detection. The Hough Transform for Parabola Detection dialog box appears.
  4. Complete the dialog box and press OK. For the first run of the algorithm enter the number of parabolas, but use the default values for the other entries. Later, you can adjust the parameters depending on the results you get.
  5. The algorithm begins to run and the progress bar appears with the status. When the algorithm finishes running, the Hough Transform Parabola Selection dialog box appears displaying the number of parabolas found.
  6. In the Hough Transform Parabola Selection dialog box, use check boxes to specify which parabolas you would like to isolate in the image, see Figure 38. Press OK.
  7. The result image appears displaying isolated parabolas.

Hough Transform for Parabola Detection dialog box

The Hough Transform for Parabola Detection dialog box is shown in the Figure on your right.

Desired xv dimension of Hough Transform image is a user defined value of dimension for xv bins in the Hough transform space. By default, it equals 512.

Desired yv dimension of Hough Transform image is a user defined value of dimension for yv bins in the Hough transform space. By default, it equals 512.

Desired phi dimension of Hough Transform image is a user defined value of dimension for phi bins in the Hough transform space. By default, it equals 360.

Phi value in degrees if phi dimension =1 - this is the phi value in radians if the desired phi dimension value equals to 1. By default, it is set to 90.

Desired p dimension of Hough Transform image - the number of dimension p bins in the Hough transform space. By default, it is set to 256.

Maximum curve points on each side for tangent - the maximum number of points to take from each side of a point on a curve in order to determine a tangent. By default, it is set to 3.

Minimum p value - the minimum value for p, by default, it is set to 0.1.

Maximum p value -the maximum value for p, by default, it is set to 256.

Maximum Hough Transform in megabytes - the maximum allowed size in memory used for Hough transform. As the memory size grows, the pixel and degree width for each bin can decrease. By default, it is set to 256 MB.

Number of parabolas - a number of parabolas to be detected. By default, the value is set to 1.