ArticleslgStudy

computer science

Hough transform

Hough transform is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Hough transform rather than just read about it. In short: The Hough transform () is a feature extraction technique used in image analysis, computer vision, pattern recognition, and digital image processing. The purpose of the technique is to find imperfect instances of objects within a certain class of shapes by a voting procedure.

Hough transform — main illustration
Hough transform — illustration

Key takeaways

  • Hough transform belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Hough transform to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Hough transform from memory before moving on to harder problems.

Reference excerpt

The Hough transform () is a feature extraction technique used in image analysis, computer vision, pattern recognition, and digital image processing. The purpose of the technique is to find imperfect instances of objects within a certain class of shapes by a voting procedure. This voting procedure is carried out in a parameter space, from which object candidates are obtained as local maxima in a so-called accumulator space that is explicitly constructed by the algorithm for computing the Hough transform. Mathematically it is simply the Radon transform in the plane, known since at least 1917, but the Hough transform refers to its use in image analysis. The classical Hough transform was concerned with the identification of lines in the image, but later the Hough transform has been extended to identifying positions of arbitrary shapes, most commonly circles or ellipses. The Hough transform as it is universally used today was invented by Richard Duda and Peter Hart in 1972, who called it a "generalized Hough transform" after the related 1962 patent of Paul Hough. The transform was popularized in the computer vision community by Dana H. Ballard through a 1981 journal article titled "Generalizing the Hough transform to detect arbitrary shapes".

History It was initially invented for machine analysis of bubble chamber photographs. The Hough transform was patented as U.S. patent 3,069,654 in 1962 and assigned to the U.S. Atomic Energy Commission with the name "Method and Means for Recognizing Complex Patterns". This patent uses a slope-intercept parametrization for straight lines, which awkwardly leads to an unbounded transform space, since the slope can go to infinity. The rho–theta parametrization universally used today was first described in , although it was already standard for the Radon transform since at least the 1930s. O'Gorman and Clowes' variation is described in . The story of how the modern form of the Hough transform was invented is given in .

Theory In automated analysis of digital images, a subproblem often arises of detecting simple shapes, such as straight lines, circles or ellipses. In many cases an edge detector can be used as a pre-processing stage to obtain image points or image pixels that are on the desired curve in the image space. Due to imperfections in either the image data or the edge detector, however, there may be missing points or pixels on the desired curves as well as spatial deviations between the ideal line/circle/ellipse and the noisy edge points as they are obtained from the edge detector. For these reasons, it is often non-trivial to group the extracted edge features to an appropriate set of lines, circles or ellipses. The purpose of the Hough transform is to address this problem by making it possible to perform groupings of edge points into object candidates by performing an explicit voting procedure over a set of parameterized image objects.

Detecting lines The simplest case of Hough transform is detecting straight lines. In general, the straight line y = mx + b can be represented as a point (b, m) in the parameter space. However, vertical lines pose a problem. They would give rise to unbounded values of the slope parameter m. Thus, for computational reasons, Duda and Hart proposed the use of the Hesse normal form

r=xcos⁡θ+ysin⁡θ, where r is the distance from the origin to the closest point on the straight line, and θ is the angle between the x axis and the line connecting the origin with that closest point. The intuition for this form, similarly to the plane equation, is that every vector on the line must be perpendicular (orthogonal) to the line segment of length r that comes from the origin. The intersection point of the function line and the perpendicular line that comes from the origin is at P0=(rcos⁡θ,rsin⁡θ). So, for any point P=(x,y) on the line, the vector P−P0 must be orthogonal to the vector P0−0=P0. This enforces (P−P0)⋅P0=0. Therefore, P⋅P0=P0⋅P0. So, we get r(xcos⁡θ+ysin⁡θ)=r2(cos2θ+sin2θ). Yet, as cos2θ+sin2θ=1, we get the final form of xcos⁡θ+ysin⁡θ=r.

It is therefore possible to associate with each line of the image a pair (r,θ). The (r,θ) plane is sometimes referred to as Hough space for the set of straight lines in two dimensions. This representation makes the Hough transform conceptually very close to the two-dimensional Radon transform. In fact, the Hough transform is mathematically equivalent to the Radon transform, but the two transformations have different computational interpretations traditionally associated with them. Given a single point in the plane, the set of all straight lines going through that point corresponds to a sinusoidal curve in the (r, θ) plane, which is unique to that point. A set of two or more points that form a straight line will produce sinusoids crossing at the (r, θ) for that line. Thus, the problem of detecting collinear points can be converted to the problem of finding concurrent curves.

Probabilistic interpretation Given a shape parametrized by (a1,...,at), taking values in the set S called the shape space, one can interpret the Hough transform as the inverse transform of a probability distribution on the image space to the shape space S, and interpret shape detection as maximum likelihood estimation. Explicitly, the Hough transform performs an approximate naive Bayes inference. We start with a uniform prior on the shape space. We consider only the positive evidence, and ignore all negative evidence, so that we can detect partially occluded shapes. We add up the log-likelihood in the shape space up to an additive constant. The assumption of naive Bayes means that all pixels in the image space provide independent evidence, so that their likelihoods multiply, that is, their log-likelihoods add. The freedom in additive constant allows us to perform no operation on the "background pixels" in shape space. Finally, we perform maximum likelihood estimation by picking out the peaks in the log-likelihood on the shape space.

… excerpt ends here. Continue reading the full article.

Illustrations

Hough transform: Example 1
Example 1
Hough transform illustration

Worked examples

Example 1 — a first encounter with Hough transform

Start with the simplest possible case. Write down what Hough transform claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Hough transform before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Hough transform ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Hough transform

In research
Hough transform appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Hough transform in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Hough transform is common in secondary-school and first-year university syllabi. It links to neighbouring topics Feature detection (computer vision), so understanding it makes those chapters shorter.
In everyday life
Look for Hough transform outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Hough transform” →

How to study Hough transform in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Hough transform means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Hough transform out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Hough transform in simple terms?

The Hough transform () is a feature extraction technique used in image analysis, computer vision, pattern recognition, and digital image processing. The purpose of the technique is to find imperfect instances of objects within a certain class of shapes by a voting procedure.

Why does Hough transform matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Hough transform?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Hough transform.

Tags

  • Feature detection (computer vision)

Keep exploring