Line detection
![]() | This article is actively undergoing a major edit for a little while. To help avoid edit conflicts, please do not edit this page while this message is displayed. This page was last edited at 02:39, 23 April 2018 (UTC) (7 years ago) – this estimate is cached, . Please remove this template if this page hasn't been edited for a significant time. If you are the editor who added this template, please be sure to remove it or replace it with {{Under construction}} between editing sessions. |
In image processing, a line is a collection of edge points that are adjacent and have the same direction. [1] Line detection is an algorithm that take a collection of n edge points and find all the lines on which these edge points lie. The most popular line detectors are the Hough transform and convolution based technique. Hough transform can be used to detect lines and the output is a parametric description of the lines in an image, for example ρ = r cos(θ) + sin(θ). If we have a line in our row and column based image space, we can define that line by ρ, the distance from the origin to the line along a perpendicular to the line, and θ, the angle of the perpendicular projection from the origin to the line measured in degrees clockwise from the positive row axis. [2] Therefore, a line in the image corresponds to a point in the Hough space.[3]
In a convolution based technique, the line detector operator consists of a convolution masks tuned to detect the presence of lines of a particular width n and a θ orientation. The figures below show an a) Horizontal kernel
-1 | -1 | -1 |
2 | 2 | 2 |
-1 | -1 | -1 |
(b) Vertical
-1 | 2 | -1 |
-1 | 2 | -1 |
-1 | 2 | -1 |
(C) Oblique (+45 degrees)
-1 | -1 | 2 |
-1 | 2 | -1 |
2 | -1 | -1 |
(d) Oblique (-45 degrees)
2 | -1 | -1 |
-1 | 2 | -1 |
-1 | -1 | 2 |
These masks above are tuned for light lines against a dark background, and would give a big negative response to dark lines against a light background.