Mealy machine: Difference between revisions
en>Adityagohad No edit summary |
en>Widr m Reverted edits by 117.211.58.148 (talk) to last version by Bgwhite |
||
Line 1: | Line 1: | ||
{{FeatureDetectionCompVisNavbox}} | |||
'''Edge detection''' is the name for a set of mathematical methods which aim at identifying points in a [[digital image]] at which the [[luminous intensity|image brightness]] changes sharply or, more formally, has discontinuities. The points at which image brightness changes sharply are typically organized into a set of curved line segments termed ''edges''. The same problem of finding discontinuities in 1D signals is known as [[step detection]] and the problem of finding signal discontinuities over time is known as [[change detection]]. Edge detection is a fundamental tool in [[image processing]], [[machine vision]] and [[computer vision]], particularly in the areas of [[feature detection (computer vision)|feature detection]] examples of operators such as Canny, Sobel, Kayyali,..etc. and [[feature extraction]].<ref>{{cite book|last=Umbaugh|first=Scott E|title=Digital image processing and analysis : human and computer vision applications with CVIPtools|year=2010|publisher=CRC Press|location=Boca Raton, FL|isbn=9-7814-3980-2052|edition=2nd ed.}}</ref> | |||
== Motivations == | |||
[[File:EdgeDetectionMathematica.png|thumb|500px|Canny edge detection applied to a photograph]] | |||
The purpose of detecting sharp changes in image brightness is to capture important events and changes in properties of the world. | |||
It can be shown that under rather general assumptions for an image formation model, discontinuities in image brightness are likely to correspond to:<ref>H.G. Barrow and J.M. Tenenbaum (1981) "Interpreting line drawings as three-dimensional surfaces", Artificial Intelligence, vol 17, issues 1-3, pages 75-116.</ref><ref name=lin95>{{SpringerEOM| title=Edge detection | id=Edge_detection | oldid=17883 | first=Tony | last=Lindeberg }}</ref> | |||
* discontinuities in depth, | |||
* discontinuities in surface orientation, | |||
* changes in material properties and | |||
* variations in scene illumination. | |||
In the ideal case, the result of applying an edge detector to an image may lead to a set of connected curves that indicate the boundaries of objects, the boundaries of surface markings as well as curves that correspond to discontinuities in surface orientation. | |||
Thus, applying an edge detection algorithm to an image may significantly reduce the amount of data to be processed and may therefore filter out information that may be regarded as less relevant, while preserving the important structural properties of an image. | |||
If the edge detection step is successful, the subsequent task of interpreting the information contents in the original image may therefore be substantially simplified. | |||
However, it is not always possible to obtain such ideal edges from real life images of moderate complexity. | |||
Edges extracted from non-trivial images are often hampered by ''fragmentation'', meaning that the edge curves are not connected, missing edge segments as well as ''false edges'' not corresponding to interesting phenomena in the image – thus complicating the subsequent task of interpreting the image data.<ref name=lin98>[http://www.nada.kth.se/cvap/abstracts/cvap191.html T. Lindeberg (1998) "Edge detection and ridge detection with automatic scale selection", International Journal of Computer Vision, 30, 2, pages 117--154.]</ref> | |||
Edge detection is one of the fundamental steps in image processing, image analysis, image pattern recognition, and computer vision techniques. | |||
== Edge properties == | |||
The edges extracted from a two-dimensional image of a three-dimensional scene can be classified as either viewpoint dependent or viewpoint independent. | |||
A ''viewpoint independent edge'' typically reflects inherent properties of the three-dimensional objects, such as surface markings and surface shape. | |||
A ''viewpoint dependent edge'' may change as the viewpoint changes, and typically reflects the geometry of the scene, such as objects occluding one another. | |||
A typical edge might for instance be the border between a block of red color and a block of yellow. In contrast a '''[[line (mathematics)|line]]''' (as can be extracted by a [[ridge detection|ridge detector]]) can be a small number of pixels of a different color on an otherwise unchanging background. For a line, there may therefore usually be one edge on each side of the line. | |||
== A simple edge model == | |||
Although certain literature has considered the detection of ideal step edges, the edges obtained from natural images are usually not at all ideal step edges. Instead they are normally affected by one or several of the following effects: | |||
* focal blur caused by a finite [[depth-of-field]] and finite [[point spread function]]. | |||
* [[penumbra|penumbral blur]] caused by shadows created by light sources of non-zero radius. | |||
* [[shading]] at a smooth object | |||
A number of researchers have used a Gaussian smoothed step edge (an error function) as the simplest extension of the ideal step edge model for modeling the effects of edge blur in practical applications.<ref name=lin98/><ref>W. Zhang and F. Bergholm (1997) "Multi-scale blur estimation and edge type classification for scene analysis", International Journal of Computer Vision, vol 24, issue 3, Pages: 219 - 250.</ref> | |||
Thus, a one-dimensional image <math>f</math> which has exactly one edge placed at <math>x = 0</math> may be modeled as: | |||
:<math>f(x) = \frac{I_r - I_l}{2} \left( \operatorname{erf}\left(\frac{x}{\sqrt{2}\sigma}\right) + 1\right) + I_l.</math> | |||
At the left side of the edge, the intensity is <math>I_l = \lim_{x \rightarrow -\infty} f(x)</math>, and right of the edge it is | |||
<math>I_r = \lim_{x \rightarrow \infty} f(x)</math>. The scale parameter <math>\sigma</math> is called the blur scale of the edge. | |||
== Why edge detection is a non-trivial task == | |||
To illustrate why edge detection is not a trivial task, consider the problem of detecting edges in the following one-dimensional signal. Here, we may intuitively say that there should be an edge between the 4th and 5th pixels. | |||
{| style="border:0; margin:0.5em auto" | |||
|- | |||
| style="border:1px solid #000; padding:5px 10px;" | 5 | |||
| style="border:1px solid #000; padding:5px 10px;" | 7 | |||
| style="border:1px solid #000; padding:5px 10px;" | 6 | |||
| style="border:1px solid #000; padding:5px 10px;" | 4 | |||
| style="border:1px solid #000; padding:5px" | 152 | |||
| style="border:1px solid #000; padding:5px" | 148 | |||
| style="border:1px solid #000; padding:5px" | 149 | |||
|- style="height:30px" | |||
| style="background:#050505" | | |||
| style="background:#070707" | | |||
| style="background:#060606" | | |||
| style="background:#040404" | | |||
| style="background:#989898" | | |||
| style="background:#949494" | | |||
| style="background:#959595" | | |||
|} | |||
If the intensity difference were smaller between the 4th and the 5th pixels and if the intensity differences between the adjacent neighboring pixels were higher, it would not be as easy to say that there should be an edge in the corresponding region. Moreover, one could argue that this case is one in which there are several edges. | |||
{| style="border:0; margin:0.5em auto" | |||
|- | |||
| style="border:1px solid #000; padding:5px 10px;" | 5 | |||
| style="border:1px solid #000; padding:5px 10px;" | 7 | |||
| style="border:1px solid #000; padding:5px 10px;" | 6 | |||
| style="border:1px solid #000; padding:5px 10px;" | 41 | |||
| style="border:1px solid #000; padding:5px" | 113 | |||
| style="border:1px solid #000; padding:5px" | 148 | |||
| style="border:1px solid #000; padding:5px" | 149 | |||
|- style="height:30px" | |||
| style="background:#050505" | | |||
| style="background:#070707" | | |||
| style="background:#060606" | | |||
| style="background:#292929" | | |||
| style="background:#717171" | | |||
| style="background:#949494" | | |||
| style="background:#959595" | | |||
|} | |||
Hence, to firmly state a specific threshold on how large the intensity change between two neighbouring pixels must be for us to say that there should be an edge between these pixels is not always simple.<ref name=lin98/> Indeed, this is one of the reasons why edge detection may be a non-trivial problem unless the objects in the scene are particularly simple and the illumination conditions can be well controlled (see for example, the edges extracted from the image with the girl above). | |||
== Approaches == | |||
There are many methods for edge detection, but most of them can be grouped into two categories, search-based and [[Zero crossing|zero-crossing]] based. | |||
The search-based methods detect edges by first computing a measure of edge strength, usually a first-order derivative expression such as the gradient magnitude, and then searching for local directional maxima of the gradient magnitude using a computed estimate of the local orientation of the edge, usually the gradient direction. | |||
The zero-crossing based methods search for zero crossings in a second-order derivative expression computed from the image in order to find edges, usually the zero-crossings of the [[Laplacian]] or the zero-crossings of a non-linear differential expression. As a pre-processing step to edge detection, a smoothing stage, typically Gaussian smoothing, is almost always applied (see also [[noise reduction]]). | |||
The edge detection methods that have been published mainly differ in the types of smoothing filters that are applied and the way the measures of edge strength are computed. As many edge detection methods rely on the computation of image gradients, they also differ in the types of filters used for computing gradient estimates in the x- and y-directions. | |||
A survey of a number of different edge detection methods can be found in (Ziou and Tabbone 1998);<ref>D. Ziou and S. Tabbone (1998) "Edge detection techniques: An overview", International Journal of Pattern Recognition and Image Analysis, 8(4):537–559, 1998</ref> see also the encyclopedia articles on edge detection in ''Encyclopedia of Mathematics''<ref name=lin95/> and Encyclopedia of Computer Science and Engineering.<ref>[http://mrw.interscience.wiley.com/emrw/9780470050118/ecse/article/ecse603/current/abstract J. M. Park and Y. Lu (2008) "Edge detection in grayscale, color, and range images", in B. W. Wah (editor) Encyclopedia of Computer Science and Engineering, doi 10.1002/9780470050118.ecse603]</ref> | |||
=== Canny edge detection === | |||
{{main | Canny edge detector}} | |||
[[John Canny]] considered the mathematical problem of deriving an optimal smoothing filter given the criteria of detection, localization and minimizing multiple responses to a single edge.<ref>J. Canny (1986) "A computational approach to edge detection", IEEE Trans. Pattern Analysis and Machine Intelligence, vol 8, pages 679-714.</ref> He showed that the optimal filter given these assumptions is a sum of four exponential terms. He also showed that this filter can be well approximated by first-order derivatives of Gaussians. | |||
Canny also introduced the notion of non-maximum suppression, which means that given the presmoothing filters, edge points are defined as points where the gradient magnitude assumes a local maximum in the gradient direction. | |||
Looking for the zero crossing of the 2nd derivative along the gradient direction was first proposed by [[Haralick]].<ref> | |||
R. Haralick, (1984) "Digital step edges from zero crossing of second directional derivatives", IEEE Trans. on Pattern Analysis and Machine Intelligence, 6(1):58–68. | |||
</ref> | |||
It took less than two decades to find a modern geometric variational meaning for that operator that links it to the [[Marr-Hildreth algorithm|Marr–Hildreth]] (zero crossing of the Laplacian) edge detector. | |||
That observation was presented by [[Ron Kimmel]] and [[Alfred Bruckstein]].<ref>[http://www.cs.technion.ac.il/~ron/PAPERS/laplacian_ijcv2003.pdf R. Kimmel and A.M. Bruckstein (2003) "On regularized Laplacian zero crossings and other optimal edge integrators", ''International Journal of Computer Vision'', 53(3) pages 225-243.]</ref> | |||
Although his work was done in the early days of computer vision, the [[Canny edge detector]] (including its variations) is still a state-of-the-art edge detector.<ref>Shapiro L.G. & Stockman G.C. (2001) Computer Vision. London etc.: Prentice Hall, Page 326.</ref> Unless the preconditions are particularly suitable, it is hard to find an edge detector that performs significantly better than the Canny edge detector. | |||
The Canny-Deriche detector was derived from similar mathematical criteria as the Canny edge detector, although starting from a discrete viewpoint and then leading to a set of recursive filters for image smoothing instead of [[exponential filter]]s or Gaussian filters.<ref>R. Deriche (1987) ''Using Canny's criteria to derive an optimal edge detector recursively implemented'', Int. J. Computer Vision, vol 1, pages 167–187.</ref> | |||
The [[Edge detection#Differential edge detection|differential edge detector]] described below can be seen as a reformulation of Canny's method from the viewpoint of differential invariants computed from a [[scale space representation]] leading to a number of advantages in terms of both theoretical analysis and sub-pixel implementation. | |||
=== Other first-order methods === | |||
Different gradient operators can be applied to estimate image gradients from the input image or a smoothed version of it. The simplest approach is to use central differences: | |||
:<math>L_x(x, y)=-1/2\cdot L(x-1, y) + 0 \cdot L(x, y) + 1/2 \cdot L(x+1, y)\,</math> | |||
:<math>L_y(x, y)=-1/2\cdot L(x, y-1) + 0 \cdot L(x, y) + 1/2 \cdot L(x, y+1),\,</math> | |||
corresponding to the application of the following filter masks to the image data: | |||
:<math> | |||
L_x = \begin{bmatrix} | |||
-1/2 & 0 & 1/2 | |||
\end{bmatrix} * L | |||
\quad \mbox{and} \quad | |||
L_y = \begin{bmatrix} | |||
+1/2 \\ | |||
0 \\ | |||
-1/2 | |||
\end{bmatrix} * L. | |||
</math> | |||
The well-known and earlier [[Sobel operator]] is based on the following filters: | |||
:<math> | |||
L_x = \begin{bmatrix} | |||
-1 & 0 & +1 \\ | |||
-2 & 0 & +2 \\ | |||
-1 & 0 & +1 | |||
\end{bmatrix} * L | |||
\quad \mbox{and} \quad | |||
L_y = \begin{bmatrix} | |||
+1 & +2 & +1 \\ | |||
0 & 0 & 0 \\ | |||
-1 & -2 & -1 | |||
\end{bmatrix} * L. | |||
</math> | |||
Given such estimates of first- order derivatives, the gradient magnitude is then computed as: | |||
:<math>|\nabla L| = \sqrt{ L_x^2 + L_y^2}</math> | |||
while the gradient orientation can be estimated as | |||
:<math>\theta = \operatorname{atan2}(L_y, L_x).</math> | |||
Other first-order difference operators for estimating image gradient have been proposed in the [[Prewitt]] operator, [[Roberts Cross|Roberts cross]] and [[Frei-Chen]]. | |||
It is possible to extend filters dimension to avoid the issue of recognizing edge in low SNR image. The cost of this operation is loss in terms of resolution. Examples are Extended Prewitt 7x7 and [[Abdou]] | |||
=== Thresholding and linking === | |||
Once we have computed a measure of edge strength (typically the gradient magnitude), the next stage is to apply a threshold, to decide whether edges are present or not at an image point. The lower the threshold, the more edges will be detected, and the result will be increasingly susceptible to [[image noise|noise]] and detecting edges of irrelevant features in the image. Conversely a high threshold may miss subtle edges, or result in fragmented edges. | |||
If the edge thresholding is applied to just the gradient magnitude image, the resulting edges will in general be thick and some type of edge thinning post-processing is necessary. For edges detected with non-maximum suppression however, the edge curves are thin by definition and the edge pixels can be linked into edge polygon by an edge linking (edge tracking) procedure. On a discrete grid, the non-maximum suppression stage can be implemented by estimating the gradient direction using first-order derivatives, then rounding off the gradient direction to multiples of 45 degrees, and finally comparing the values of the gradient magnitude in the estimated gradient direction. | |||
A commonly used approach to handle the problem of appropriate thresholds for thresholding is by using [[Adaptive thresholding|thresholding]] with [[hysteresis]]. This method uses multiple thresholds to find edges. We begin by using the upper threshold to find the start of an edge. Once we have a start point, we then trace the path of the edge through the image pixel by pixel, marking an edge whenever we are above the lower threshold. We stop marking our edge only when the value falls below our lower threshold. This approach makes the assumption that edges are likely to be in continuous curves, and allows us to follow a faint section of an edge we have previously seen, without meaning that every noisy pixel in the image is marked down as an edge. Still, however, we have the problem of choosing appropriate thresholding parameters, and suitable thresholding values may vary over the image. | |||
=== Edge thinning === | |||
Edge thinning is a technique used to remove the unwanted spurious points on the edges in an image. This technique is employed after the image has been filtered for noise (using median, Gaussian filter etc.), the edge operator has been applied (like the ones described above) to detect the edges and after the edges have been smoothed using an appropriate threshold value. | |||
This removes all the unwanted points and if applied carefully, results in one pixel thick edge elements. | |||
Advantages: | |||
# Sharp and thin edges lead to greater efficiency in object recognition. | |||
# If [[Hough transform]]s are used to detect lines and ellipses, then thinning could give much better results. | |||
# If the edge happens to be the boundary of a region, then thinning could easily give the image parameters like perimeter without much algebra. | |||
There are many popular algorithms used to do this, one such is described below: | |||
# Choose a type of connectivity, like 8, 6 or 4. | |||
# 8 connectivity is preferred, where all the immediate pixels surrounding a particular pixel are considered. | |||
# Remove points from North, south, east and west. | |||
# Do this in multiple passes, i.e. after the north pass, use the same semi processed image in the other passes and so on. | |||
# Remove a point if:<br />The point has no neighbors in the North (if you are in the north pass, and respective directions for other passes).<br />The point is not the end of a line.<br />The point is isolated.<br />Removing the points will not cause to disconnect its neighbors in any way. | |||
# Else keep the point. | |||
The number of passes across direction should be chosen according to the level of accuracy desired. | |||
=== Second-order approaches to edge detection === | |||
Some edge-detection operators are instead based upon second-order derivatives of the intensity. This essentially captures the [[Derivative|rate of change]] in the intensity gradient. Thus, in the ideal continuous case, detection of zero-crossings in the second derivative captures local maxima in the gradient. | |||
The early [[Marr-Hildreth algorithm|Marr-Hildreth]] operator is based on the detection of zero-crossings of the Laplacian operator applied to a Gaussian-smoothed image. It can be shown, however, that this operator will also return false edges corresponding to local minima of the gradient magnitude. Moreover, this operator will give poor localization at curved edges. Hence, this operator is today mainly of historical interest. | |||
==== Differential edge detection ==== | |||
A more refined second-order edge detection approach which automatically detects edges with sub-pixel accuracy, uses the following ''differential approach'' of detecting zero-crossings of the second-order directional derivative in the gradient direction: | |||
Following the differential geometric way of expressing the requirement of non-maximum suppression proposed by Lindeberg,<ref name=lin98/><ref name=lin93>[http://www.nada.kth.se/~tony/abstracts/Lin93-JMIV.html T. Lindeberg (1993) "Discrete derivative approximations with scale-space properties: A basis for low-level feature extraction", J. of Mathematical Imaging and Vision, 3(4), pages 349--376.]</ref> let us introduce at every image point a local coordinate system <math>(u, v)</math>, with the <math>v</math>-direction parallel to the gradient direction. Assuming that the image has been pre-smoothed by Gaussian smoothing and a [[scale space representation]] <math>L(x, y; t)</math> at scale <math>t</math> has been computed, we can require that the gradient magnitude of the [[scale space representation]], which is equal to the first-order directional derivative in the <math>v</math>-direction <math>L_v</math>, should have its first order directional derivative in the <math>v</math>-direction equal to zero | |||
:<math>\partial_v(L_v) = 0</math> | |||
while the second-order directional derivative in the <math>v</math>-direction of <math>L_v</math> should be negative, i.e., | |||
:<math>\partial_{vv}(L_v) \leq 0.</math> | |||
Written out as an explicit expression in terms of local partial derivatives <math>L_x</math>, <math>L_y</math> ... <math>L_{yyy}</math>, this edge definition can be expressed as the zero-crossing curves of the differential invariant | |||
:<math>L_v^2 L_{vv} = L_x^2 \, L_{xx} + 2 \, L_x \, L_y \, L_{xy} + L_y^2 \, L_{yy} = 0,</math> | |||
that satisfy a sign-condition on the following differential invariant | |||
:<math>L_v^3 L_{vvv} = L_x^3 \, L_{xxx} + 3 \, L_x^2 \, L_y \, L_{xxy} + 3 \, L_x \, L_y^2 \, L_{xyy} + L_y^3 \, L_{yyy} \leq 0</math> | |||
where <math>L_x</math>, <math>L_y</math> ... <math>L_{yyy}</math> denote partial derivatives computed from | |||
a [[scale space representation]] <math>L</math> obtained by smoothing the original image with a Gaussian kernel. | |||
In this way, the edges will be automatically obtained as continuous curves with sub-pixel accuracy. | |||
Hysteresis thresholding can also be applied to these differential and subpixel edge segments. | |||
In practice, first-order derivative approximations can be computed by central differences as described above, while second-order derivatives can be computed from the [[scale space representation]] <math>L</math> according to: | |||
:<math>L_{xx}(x, y) = L(x-1, y) - 2 L(x, y) + L(x+1, y).\,</math> | |||
:<math>L_{xy}(x, y) = (L(x-1, y-1) - L(x-1, y+1) - L(x+1, y-1) + L(x+1, y+1))/4, \,</math> | |||
:<math>L_{yy}(x, y) = L(x, y-1) - 2 L(x, y) + L(x, y+1).\,</math> | |||
corresponding to the following filter masks: | |||
:<math> | |||
L_{xx} = \begin{bmatrix} | |||
1 & -2 & 1 | |||
\end{bmatrix} * L | |||
\quad \mbox{and} \quad | |||
L_{xy} = \begin{bmatrix} | |||
-1/4 & 0 & 1/4 \\ | |||
0 & 0 & 0\\ | |||
1/4 & 0 & -1/4 | |||
\end{bmatrix} * L | |||
\quad \mbox{and} \quad | |||
L_{yy} = \begin{bmatrix} | |||
1 \\ | |||
-2 \\ | |||
1 | |||
\end{bmatrix} * L. | |||
</math> | |||
Higher-order derivatives for the third-order sign condition can be obtained in an analogous fashion. | |||
=== Phase congruency-based edge detection === | |||
A recent development in edge detection techniques takes a frequency domain approach to finding edge locations. [[Phase congruency]] (also known as phase coherence) methods attempt to find locations in an image where all sinusoids in the frequency domain are in phase. These locations will generally correspond to the location of a perceived edge, regardless of whether the edge is represented by a large change in intensity in the spatial domain. A key benefit of this technique is that it responds strongly to [[Mach bands]], and avoids false positives typically found around [[roof edge]]s. A roof edge, is a discontinuity in the first order derivative of a grey-level profile.<ref>T. Pajdla and V. Hlavac (1993) "Surface discontinuities in range images," in Proc IEEE 4th Int. Conf. Comput. Vision, pp. 524-528.</ref> | |||
==See also== | |||
*[[Canny edge detector]] | |||
*[[Gabor filter]] | |||
*[[Hough transform]] for detecting straight lines, circles or ellipses from edge points | |||
*[[Feature detection (computer vision)]] for other low-level feature detectors | |||
*[[Image noise reduction]] | |||
*[[Prewitt operator]] | |||
*[[Ridge detection]] for relations between edge detectors and ridge detectors | |||
*[[Scale space]] for theory of Gaussian image smoothing and multi-scale feature detection | |||
*[[Sobel operator]] | |||
*[[Kirsch operator]] for edge detection in the compass directions | |||
*[[Convolution#Applications]] | |||
*[[Kayyali operator for edge detection]] | |||
*[http://www.edgedetection.webs.com Sobel and Kayyali edge detection comparison] | |||
*[[ Fuzzy logic object outline detection ]] <ref> BARGHOUT, Lauren. "SYSTEM AND METHOD FOR EDGE DETECTION IN IMAGE PROCESSING AND RECOGNITION." WIPO Patent No. 2007044828. 20 Apr. 2007. </ref> | |||
==References== | |||
<references /> | |||
==Further reading== | |||
*{{SpringerEOM| title=Edge detection | id=Edge_detection | oldid=17883 | first=Tony | last=Lindeberg }} | |||
*[http://www.mygeeksite.in/search/label/OpenCV Edge detection tutorials in OpenCV] | |||
*[http://mrw.interscience.wiley.com/emrw/9780470050118/ecse/article/ecse603/current/abstract Entry on edge detection in Encyclopedia of Computer Science and Engineering] | |||
*[http://edge.kitiyo.com/ Edge Detection using FPGA] | |||
*[http://dx.doi.org/10.5201/ipol.2012.gjmr-lsd A-contrario line segment detection with code and on-line demonstration] | |||
*[http://ccv.nuigroup.com/ CCV - A Community Developed Vision Framework] | |||
* [http://www.burgsys.com/mumi-image-mining-community.php IMMI - Rapidminer Image Mining Extension] - open-source tool for image mining | |||
*[http://intopii.com/into/ Into] contains open source implementations of several edge detection algorithms in C++ | |||
* [http://www.iprg.co.in IPRG] Image Processing - Online Open Research Group | |||
*[http://www.mathworks.com/discovery/edge-detection.html Edge detection using computer algorithms] | |||
{{DEFAULTSORT:Edge Detection}} | |||
[[Category:Feature detection]] | |||
* [http://www.edgedetection.webs.com Sobel and Kayyali edge detection comparison] |
Revision as of 06:35, 4 February 2014
Template:FeatureDetectionCompVisNavbox
Edge detection is the name for a set of mathematical methods which aim at identifying points in a digital image at which the image brightness changes sharply or, more formally, has discontinuities. The points at which image brightness changes sharply are typically organized into a set of curved line segments termed edges. The same problem of finding discontinuities in 1D signals is known as step detection and the problem of finding signal discontinuities over time is known as change detection. Edge detection is a fundamental tool in image processing, machine vision and computer vision, particularly in the areas of feature detection examples of operators such as Canny, Sobel, Kayyali,..etc. and feature extraction.[1]
Motivations
The purpose of detecting sharp changes in image brightness is to capture important events and changes in properties of the world. It can be shown that under rather general assumptions for an image formation model, discontinuities in image brightness are likely to correspond to:[2][3]
- discontinuities in depth,
- discontinuities in surface orientation,
- changes in material properties and
- variations in scene illumination.
In the ideal case, the result of applying an edge detector to an image may lead to a set of connected curves that indicate the boundaries of objects, the boundaries of surface markings as well as curves that correspond to discontinuities in surface orientation. Thus, applying an edge detection algorithm to an image may significantly reduce the amount of data to be processed and may therefore filter out information that may be regarded as less relevant, while preserving the important structural properties of an image. If the edge detection step is successful, the subsequent task of interpreting the information contents in the original image may therefore be substantially simplified. However, it is not always possible to obtain such ideal edges from real life images of moderate complexity.
Edges extracted from non-trivial images are often hampered by fragmentation, meaning that the edge curves are not connected, missing edge segments as well as false edges not corresponding to interesting phenomena in the image – thus complicating the subsequent task of interpreting the image data.[4]
Edge detection is one of the fundamental steps in image processing, image analysis, image pattern recognition, and computer vision techniques.
Edge properties
The edges extracted from a two-dimensional image of a three-dimensional scene can be classified as either viewpoint dependent or viewpoint independent. A viewpoint independent edge typically reflects inherent properties of the three-dimensional objects, such as surface markings and surface shape. A viewpoint dependent edge may change as the viewpoint changes, and typically reflects the geometry of the scene, such as objects occluding one another.
A typical edge might for instance be the border between a block of red color and a block of yellow. In contrast a line (as can be extracted by a ridge detector) can be a small number of pixels of a different color on an otherwise unchanging background. For a line, there may therefore usually be one edge on each side of the line.
A simple edge model
Although certain literature has considered the detection of ideal step edges, the edges obtained from natural images are usually not at all ideal step edges. Instead they are normally affected by one or several of the following effects:
- focal blur caused by a finite depth-of-field and finite point spread function.
- penumbral blur caused by shadows created by light sources of non-zero radius.
- shading at a smooth object
A number of researchers have used a Gaussian smoothed step edge (an error function) as the simplest extension of the ideal step edge model for modeling the effects of edge blur in practical applications.[4][5] Thus, a one-dimensional image which has exactly one edge placed at may be modeled as:
At the left side of the edge, the intensity is , and right of the edge it is . The scale parameter is called the blur scale of the edge.
Why edge detection is a non-trivial task
To illustrate why edge detection is not a trivial task, consider the problem of detecting edges in the following one-dimensional signal. Here, we may intuitively say that there should be an edge between the 4th and 5th pixels.
5 | 7 | 6 | 4 | 152 | 148 | 149 |
If the intensity difference were smaller between the 4th and the 5th pixels and if the intensity differences between the adjacent neighboring pixels were higher, it would not be as easy to say that there should be an edge in the corresponding region. Moreover, one could argue that this case is one in which there are several edges.
5 | 7 | 6 | 41 | 113 | 148 | 149 |
Hence, to firmly state a specific threshold on how large the intensity change between two neighbouring pixels must be for us to say that there should be an edge between these pixels is not always simple.[4] Indeed, this is one of the reasons why edge detection may be a non-trivial problem unless the objects in the scene are particularly simple and the illumination conditions can be well controlled (see for example, the edges extracted from the image with the girl above).
Approaches
There are many methods for edge detection, but most of them can be grouped into two categories, search-based and zero-crossing based. The search-based methods detect edges by first computing a measure of edge strength, usually a first-order derivative expression such as the gradient magnitude, and then searching for local directional maxima of the gradient magnitude using a computed estimate of the local orientation of the edge, usually the gradient direction. The zero-crossing based methods search for zero crossings in a second-order derivative expression computed from the image in order to find edges, usually the zero-crossings of the Laplacian or the zero-crossings of a non-linear differential expression. As a pre-processing step to edge detection, a smoothing stage, typically Gaussian smoothing, is almost always applied (see also noise reduction).
The edge detection methods that have been published mainly differ in the types of smoothing filters that are applied and the way the measures of edge strength are computed. As many edge detection methods rely on the computation of image gradients, they also differ in the types of filters used for computing gradient estimates in the x- and y-directions.
A survey of a number of different edge detection methods can be found in (Ziou and Tabbone 1998);[6] see also the encyclopedia articles on edge detection in Encyclopedia of Mathematics[3] and Encyclopedia of Computer Science and Engineering.[7]
Canny edge detection
Mining Engineer (Excluding Oil ) Truman from Alma, loves to spend time knotting, largest property developers in singapore developers in singapore and stamp collecting. Recently had a family visit to Urnes Stave Church. John Canny considered the mathematical problem of deriving an optimal smoothing filter given the criteria of detection, localization and minimizing multiple responses to a single edge.[8] He showed that the optimal filter given these assumptions is a sum of four exponential terms. He also showed that this filter can be well approximated by first-order derivatives of Gaussians. Canny also introduced the notion of non-maximum suppression, which means that given the presmoothing filters, edge points are defined as points where the gradient magnitude assumes a local maximum in the gradient direction. Looking for the zero crossing of the 2nd derivative along the gradient direction was first proposed by Haralick.[9] It took less than two decades to find a modern geometric variational meaning for that operator that links it to the Marr–Hildreth (zero crossing of the Laplacian) edge detector. That observation was presented by Ron Kimmel and Alfred Bruckstein.[10]
Although his work was done in the early days of computer vision, the Canny edge detector (including its variations) is still a state-of-the-art edge detector.[11] Unless the preconditions are particularly suitable, it is hard to find an edge detector that performs significantly better than the Canny edge detector.
The Canny-Deriche detector was derived from similar mathematical criteria as the Canny edge detector, although starting from a discrete viewpoint and then leading to a set of recursive filters for image smoothing instead of exponential filters or Gaussian filters.[12]
The differential edge detector described below can be seen as a reformulation of Canny's method from the viewpoint of differential invariants computed from a scale space representation leading to a number of advantages in terms of both theoretical analysis and sub-pixel implementation.
Other first-order methods
Different gradient operators can be applied to estimate image gradients from the input image or a smoothed version of it. The simplest approach is to use central differences:
corresponding to the application of the following filter masks to the image data:
The well-known and earlier Sobel operator is based on the following filters:
Given such estimates of first- order derivatives, the gradient magnitude is then computed as:
while the gradient orientation can be estimated as
Other first-order difference operators for estimating image gradient have been proposed in the Prewitt operator, Roberts cross and Frei-Chen.
It is possible to extend filters dimension to avoid the issue of recognizing edge in low SNR image. The cost of this operation is loss in terms of resolution. Examples are Extended Prewitt 7x7 and Abdou
Thresholding and linking
Once we have computed a measure of edge strength (typically the gradient magnitude), the next stage is to apply a threshold, to decide whether edges are present or not at an image point. The lower the threshold, the more edges will be detected, and the result will be increasingly susceptible to noise and detecting edges of irrelevant features in the image. Conversely a high threshold may miss subtle edges, or result in fragmented edges.
If the edge thresholding is applied to just the gradient magnitude image, the resulting edges will in general be thick and some type of edge thinning post-processing is necessary. For edges detected with non-maximum suppression however, the edge curves are thin by definition and the edge pixels can be linked into edge polygon by an edge linking (edge tracking) procedure. On a discrete grid, the non-maximum suppression stage can be implemented by estimating the gradient direction using first-order derivatives, then rounding off the gradient direction to multiples of 45 degrees, and finally comparing the values of the gradient magnitude in the estimated gradient direction.
A commonly used approach to handle the problem of appropriate thresholds for thresholding is by using thresholding with hysteresis. This method uses multiple thresholds to find edges. We begin by using the upper threshold to find the start of an edge. Once we have a start point, we then trace the path of the edge through the image pixel by pixel, marking an edge whenever we are above the lower threshold. We stop marking our edge only when the value falls below our lower threshold. This approach makes the assumption that edges are likely to be in continuous curves, and allows us to follow a faint section of an edge we have previously seen, without meaning that every noisy pixel in the image is marked down as an edge. Still, however, we have the problem of choosing appropriate thresholding parameters, and suitable thresholding values may vary over the image.
Edge thinning
Edge thinning is a technique used to remove the unwanted spurious points on the edges in an image. This technique is employed after the image has been filtered for noise (using median, Gaussian filter etc.), the edge operator has been applied (like the ones described above) to detect the edges and after the edges have been smoothed using an appropriate threshold value. This removes all the unwanted points and if applied carefully, results in one pixel thick edge elements.
Advantages:
- Sharp and thin edges lead to greater efficiency in object recognition.
- If Hough transforms are used to detect lines and ellipses, then thinning could give much better results.
- If the edge happens to be the boundary of a region, then thinning could easily give the image parameters like perimeter without much algebra.
There are many popular algorithms used to do this, one such is described below:
- Choose a type of connectivity, like 8, 6 or 4.
- 8 connectivity is preferred, where all the immediate pixels surrounding a particular pixel are considered.
- Remove points from North, south, east and west.
- Do this in multiple passes, i.e. after the north pass, use the same semi processed image in the other passes and so on.
- Remove a point if:
The point has no neighbors in the North (if you are in the north pass, and respective directions for other passes).
The point is not the end of a line.
The point is isolated.
Removing the points will not cause to disconnect its neighbors in any way. - Else keep the point.
The number of passes across direction should be chosen according to the level of accuracy desired.
Second-order approaches to edge detection
Some edge-detection operators are instead based upon second-order derivatives of the intensity. This essentially captures the rate of change in the intensity gradient. Thus, in the ideal continuous case, detection of zero-crossings in the second derivative captures local maxima in the gradient.
The early Marr-Hildreth operator is based on the detection of zero-crossings of the Laplacian operator applied to a Gaussian-smoothed image. It can be shown, however, that this operator will also return false edges corresponding to local minima of the gradient magnitude. Moreover, this operator will give poor localization at curved edges. Hence, this operator is today mainly of historical interest.
Differential edge detection
A more refined second-order edge detection approach which automatically detects edges with sub-pixel accuracy, uses the following differential approach of detecting zero-crossings of the second-order directional derivative in the gradient direction:
Following the differential geometric way of expressing the requirement of non-maximum suppression proposed by Lindeberg,[4][13] let us introduce at every image point a local coordinate system , with the -direction parallel to the gradient direction. Assuming that the image has been pre-smoothed by Gaussian smoothing and a scale space representation at scale has been computed, we can require that the gradient magnitude of the scale space representation, which is equal to the first-order directional derivative in the -direction , should have its first order directional derivative in the -direction equal to zero
while the second-order directional derivative in the -direction of should be negative, i.e.,
Written out as an explicit expression in terms of local partial derivatives , ... , this edge definition can be expressed as the zero-crossing curves of the differential invariant
that satisfy a sign-condition on the following differential invariant
where , ... denote partial derivatives computed from a scale space representation obtained by smoothing the original image with a Gaussian kernel. In this way, the edges will be automatically obtained as continuous curves with sub-pixel accuracy. Hysteresis thresholding can also be applied to these differential and subpixel edge segments.
In practice, first-order derivative approximations can be computed by central differences as described above, while second-order derivatives can be computed from the scale space representation according to:
corresponding to the following filter masks:
Higher-order derivatives for the third-order sign condition can be obtained in an analogous fashion.
Phase congruency-based edge detection
A recent development in edge detection techniques takes a frequency domain approach to finding edge locations. Phase congruency (also known as phase coherence) methods attempt to find locations in an image where all sinusoids in the frequency domain are in phase. These locations will generally correspond to the location of a perceived edge, regardless of whether the edge is represented by a large change in intensity in the spatial domain. A key benefit of this technique is that it responds strongly to Mach bands, and avoids false positives typically found around roof edges. A roof edge, is a discontinuity in the first order derivative of a grey-level profile.[14]
See also
- Canny edge detector
- Gabor filter
- Hough transform for detecting straight lines, circles or ellipses from edge points
- Feature detection (computer vision) for other low-level feature detectors
- Image noise reduction
- Prewitt operator
- Ridge detection for relations between edge detectors and ridge detectors
- Scale space for theory of Gaussian image smoothing and multi-scale feature detection
- Sobel operator
- Kirsch operator for edge detection in the compass directions
- Convolution#Applications
- Kayyali operator for edge detection
- Sobel and Kayyali edge detection comparison
- Fuzzy logic object outline detection [15]
References
- ↑ 20 year-old Real Estate Agent Rusty from Saint-Paul, has hobbies and interests which includes monopoly, property developers in singapore and poker. Will soon undertake a contiki trip that may include going to the Lower Valley of the Omo.
My blog: http://www.primaboinca.com/view_profile.php?userid=5889534 - ↑ H.G. Barrow and J.M. Tenenbaum (1981) "Interpreting line drawings as three-dimensional surfaces", Artificial Intelligence, vol 17, issues 1-3, pages 75-116.
- ↑ 3.0 3.1 53 yrs old Fitter (Common ) Batterton from Carp, likes to spend some time kid advocate, property developers in singapore and handball. Completed a cruise liner experience that was comprised of passing by Gusuku Sites and Related Properties of the Kingdom of Ryukyu.
Here is my web page www.mtfgaming.com - ↑ 4.0 4.1 4.2 4.3 T. Lindeberg (1998) "Edge detection and ridge detection with automatic scale selection", International Journal of Computer Vision, 30, 2, pages 117--154.
- ↑ W. Zhang and F. Bergholm (1997) "Multi-scale blur estimation and edge type classification for scene analysis", International Journal of Computer Vision, vol 24, issue 3, Pages: 219 - 250.
- ↑ D. Ziou and S. Tabbone (1998) "Edge detection techniques: An overview", International Journal of Pattern Recognition and Image Analysis, 8(4):537–559, 1998
- ↑ J. M. Park and Y. Lu (2008) "Edge detection in grayscale, color, and range images", in B. W. Wah (editor) Encyclopedia of Computer Science and Engineering, doi 10.1002/9780470050118.ecse603
- ↑ J. Canny (1986) "A computational approach to edge detection", IEEE Trans. Pattern Analysis and Machine Intelligence, vol 8, pages 679-714.
- ↑ R. Haralick, (1984) "Digital step edges from zero crossing of second directional derivatives", IEEE Trans. on Pattern Analysis and Machine Intelligence, 6(1):58–68.
- ↑ R. Kimmel and A.M. Bruckstein (2003) "On regularized Laplacian zero crossings and other optimal edge integrators", International Journal of Computer Vision, 53(3) pages 225-243.
- ↑ Shapiro L.G. & Stockman G.C. (2001) Computer Vision. London etc.: Prentice Hall, Page 326.
- ↑ R. Deriche (1987) Using Canny's criteria to derive an optimal edge detector recursively implemented, Int. J. Computer Vision, vol 1, pages 167–187.
- ↑ T. Lindeberg (1993) "Discrete derivative approximations with scale-space properties: A basis for low-level feature extraction", J. of Mathematical Imaging and Vision, 3(4), pages 349--376.
- ↑ T. Pajdla and V. Hlavac (1993) "Surface discontinuities in range images," in Proc IEEE 4th Int. Conf. Comput. Vision, pp. 524-528.
- ↑ BARGHOUT, Lauren. "SYSTEM AND METHOD FOR EDGE DETECTION IN IMAGE PROCESSING AND RECOGNITION." WIPO Patent No. 2007044828. 20 Apr. 2007.
Further reading
- 53 yrs old Fitter (Common ) Batterton from Carp, likes to spend some time kid advocate, property developers in singapore and handball. Completed a cruise liner experience that was comprised of passing by Gusuku Sites and Related Properties of the Kingdom of Ryukyu.
Here is my web page www.mtfgaming.com - Edge detection tutorials in OpenCV
- Entry on edge detection in Encyclopedia of Computer Science and Engineering
- Edge Detection using FPGA
- A-contrario line segment detection with code and on-line demonstration
- CCV - A Community Developed Vision Framework
- IMMI - Rapidminer Image Mining Extension - open-source tool for image mining
- Into contains open source implementations of several edge detection algorithms in C++
- IPRG Image Processing - Online Open Research Group
- Edge detection using computer algorithms
- Sobel and Kayyali edge detection comparison