ArticleslgStudy

computer science

Corner detection

Corner detection 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 Corner detection rather than just read about it. In short: Corner detection is an approach used within computer vision systems to extract certain kinds of features and infer the contents of an image. Corner detection is frequently used in motion detection, image registration, video tracking, image mosaicing, panorama stitching, 3D reconstruction and object recognition.

Corner detection — main illustration
Corner detection — illustration

Key takeaways

  • Corner detection 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 Corner detection to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Corner detection from memory before moving on to harder problems.

Reference excerpt

Corner detection is an approach used within computer vision systems to extract certain kinds of features and infer the contents of an image. Corner detection is frequently used in motion detection, image registration, video tracking, image mosaicing, panorama stitching, 3D reconstruction and object recognition. Corner detection overlaps with the topic of interest point detection.

Formalization A corner can be defined as the intersection of two edges. A corner can also be defined as a point for which there are two dominant and different edge directions in a local neighbourhood of the point. An interest point is a point in an image which has a well-defined position and can be robustly detected. This means that an interest point can be a corner but it can also be, for example, an isolated point of local intensity maximum or minimum, line endings, or a point on a curve where the curvature is locally maximal. In practice, most so-called corner detection methods detect interest points in general, and in fact, the term "corner" and "interest point" are used more or less interchangeably through the literature. As a consequence, if only corners are to be detected it is necessary to do a local analysis of detected interest points to determine which of these are real corners. Examples of edge detection that can be used with post-processing to detect corners are the Kirsch operator and the Frei-Chen masking set. "Corner", "interest point" and "feature" are used interchangeably in literature, confusing the issue. Specifically, there are several blob detectors that can be referred to as "interest point operators", but which are sometimes erroneously referred to as "corner detectors". Moreover, there exists a notion of ridge detection to capture the presence of elongated objects. Corner detectors are not usually very robust and often require large redundancies introduced to prevent the effect of individual errors from dominating the recognition task. One determination of the quality of a corner detector is its ability to detect the same corner in multiple similar images, under conditions of different lighting, translation, rotation and other transforms. A simple approach to corner detection in images is using correlation, but this gets very computationally expensive and suboptimal. An alternative approach used frequently is based on a method proposed by Harris and Stephens (below), which in turn is an improvement of a method by Moravec.

Moravec corner detection algorithm This is one of the earliest corner detection algorithms and defines a corner to be a point with low self-similarity. The algorithm tests each pixel in the image to see whether a corner is present by considering how similar a patch centered on the pixel is to nearby, largely overlapping patches. The similarity is measured by taking the sum of squared differences (SSD) between the corresponding pixels of two patches. A lower number indicates more similarity. If the pixel is in a region of uniform intensity, then the nearby patches will look similar. If the pixel is on an edge, then nearby patches in a direction perpendicular to the edge will look quite different, but nearby patches in a direction parallel to the edge will result in only a small change. If the pixel is on a feature with variation in all directions, then none of the nearby patches will look similar. The corner strength is defined as the smallest SSD between the patch and its neighbours (horizontal, vertical and on the two diagonals). The reason is that if this number is high, then the variation along all shifts is either equal to it or larger than it, so capturing that all nearby patches look different. If the corner strength number is computed for all locations, that it is locally maximal for one location indicates that a feature of interest is present in it. As pointed out by Moravec, one of the main problems with this operator is that it is not isotropic: if an edge is present that is not in the direction of the neighbours (horizontal, vertical, or diagonal), then the smallest SSD will be large and the edge will be incorrectly chosen as an interest point.

The Harris & Stephens / Shi–Tomasi corner detection algorithms

Harris and Stephens improved upon Moravec's corner detector by considering the differential of the corner score with respect to direction directly, instead of using shifted patches. (This corner score is often referred to as autocorrelation, since the term is used in the paper in which this detector is described. However, the mathematics in the paper clearly indicate that the sum of squared differences is used.) Without loss of generality, we will assume a grayscale 2-dimensional image is used. Let this image be given by I. Consider taking an image patch over the area (u,v) and shifting it by (x,y). The weighted sum of squared differences (SSD) between these two patches, denoted S, is given by S(x,y)=∑u∑vw(u,v)[I(u+x,v+y)−I(u,v)]2. I(u+x,v+y) can be approximated by a Taylor expansion. Let Ix and Iy be the partial derivatives of I, such that I(u+x,v+y)≈I(u,v)+Ix(u,v)x+Iy(u,v)y. This produces the approximation S(x,y)≈∑u∑vw(u,v)[Ix(u,v)x+Iy(u,v)y]2, which can be written in matrix form: S(x,y)≈[xy]A[xy], where A is the structure tensor, A=∑u∑vw(u,v)[Ix(u,v)2Ix(u,v)Iy(u,v)Ix(u,v)Iy(u,v)Iy(u,v)2]=[⟨Ix2⟩⟨IxIy⟩⟨IxIy⟩⟨Iy2⟩]. In words, we find the covariance of the partial derivative of the image intensity I with respect to the x and y axes. Angle brackets denote averaging (i.e. summation over (u,v)), and w(u,v) denotes the type of window that slides over the image. If a box filter is used, the response will be anisotropic, but if a Gaussian is used, then the response will be isotropic. A corner (or in general an interest point) is characterized by a large variation of S in all directions of the vector [xy]. By analyzing the eigenvalues of A, this characterization can be expressed in the following way: A should have two "large" eigenvalues for an interest point. Based on the magnitudes of the eigenvalues, the following inferences can be made based on this argument:

… excerpt ends here. Continue reading the full article.

Illustrations

Corner detection: Output of a typical corner detection algorithm
Output of a typical corner detection algorithm
Corner detection: Egomotion estimation using corner detection
Egomotion estimation using corner detection
Corner detection: Corner detection using the Förstner Algorithm
Corner detection using the Förstner Algorithm

Worked examples

Example 1 — a first encounter with Corner detection

Start with the simplest possible case. Write down what Corner detection 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 Corner detection 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 Corner detection 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 Corner detection

In research
Corner detection 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 Corner detection 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
Corner detection 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 Corner detection 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 “Corner detection” →

How to study Corner detection in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Corner detection 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 Corner detection out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Corner detection in simple terms?

Corner detection is an approach used within computer vision systems to extract certain kinds of features and infer the contents of an image. Corner detection is frequently used in motion detection, image registration, video tracking, image mosaicing, panorama stitching, 3D reconstruction and object…

Why does Corner detection 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 Corner detection?

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 Corner detection.

Tags

  • Feature detection (computer vision)

Keep exploring