Contact geometry: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>David Farris
→‎Applications: Eliashberg, not gompf! Gompf reformulated Eliashberg's theorem in the four-dimensional case
 
en>FrescoBot
m Bot: fixing section wikilinks and minor changes
Line 1: Line 1:
Hi there. My title is Sophia Meagher although it is not the title on my birth certificate. Invoicing is my occupation. Alaska is the only place I've been residing in but now I'm contemplating other choices. It's not a common thing but what she likes doing is to play domino but she doesn't have the time lately.<br><br>Also visit my webpage - [http://brasil.tv/users/MIYUK clairvoyant psychic]
{{FeatureDetectionCompVisNavbox}}
 
The '''Canny edge detector''' is an [[edge detection]] operator that uses a multi-stage [[algorithm]] to detect a wide range of edges in images. It was developed by [[John F. Canny]] in 1986. Canny also produced a ''computational theory of edge detection'' explaining why the technique works.
 
[[Image:Valve monochrome canny (6).PNG|thumb|300px|right|The Canny edge detector applied to a colour photograph of a steam engine. (See the original image [[:Image:Valve original (1).PNG|here]])]]
 
== Development of the Canny algorithm ==
Canny's aim was to discover the optimal edge detection algorithm. In this situation, an "optimal" edge detector means:
* ''good detection'' – the algorithm should mark as many real edges in the image as possible.
* ''good localization'' – edges marked should be as close as possible to the edge in the real image.
* ''minimal response'' – a given edge in the image should only be marked once, and where possible, image noise should not create false edges.
 
To satisfy these requirements Canny used the [[calculus of variations]] – a technique which finds the [[function (mathematics)|function]] which optimizes a given [[functional (mathematics)|functional]]. The optimal function in Canny's detector is described by the sum of four [[Exponential function|exponential]] terms, but it can be approximated by the first [[derivative]] of a [[Gaussian function|Gaussian]].
 
== Stages of the Canny algorithm ==
=== Noise reduction ===
[[Image:Valve gaussian (2).PNG|thumb|200px|right|The image after a 5x5 Gaussian mask has been passed across each pixel.]]
 
Because the Canny edge detector is susceptible to noise present in raw unprocessed image data, it uses a filter based on a Gaussian (bell curve), where the raw image is [[convolution|convolved]] with a [[Gaussian filter]].  The result is a slightly [[Gaussian blur|blurred]] version of the original which is not affected by a single noisy pixel to any significant degree.
 
Here is an example of a 5x5 Gaussian filter, used to create the image to the right, with <math>\sigma</math> = 1.4.  (The asterisk denotes a [[convolution]] operation.)
 
:<math>
\mathbf{B} = \frac{1}{159} \begin{bmatrix}
2 & 4 & 5 & 4 & 2 \\
4 & 9 & 12 & 9 & 4 \\
5 & 12 & 15 & 12 & 5 \\
4 & 9 & 12 & 9 & 4 \\
2 & 4 & 5 & 4 & 2
\end{bmatrix} * \mathbf{A}.
</math>
 
=== Finding the intensity gradient of the image ===
An edge in an image may point in a variety of directions, so the Canny algorithm uses four filters to detect horizontal, vertical and diagonal edges in the blurred image.  The [[Edge detection|edge detection operator]] ([[Roberts Cross|Roberts]], [[Prewitt]], [[Sobel operator|Sobel]] for example) returns a value for the first derivative in the horizontal direction (G<sub>x</sub>) and the vertical direction (G<sub>y</sub>). From this the edge gradient and direction can be determined:
 
:<math>\mathbf{G} = \sqrt{ {\mathbf{G}_x}^2 + {\mathbf{G}_y}^2 }</math>
 
:<math>\mathbf{\Theta} = \operatorname{atan2}\left(\mathbf{G}_y, \mathbf{G}_x\right)</math>,
 
where [[atan2]] is the arctangent function with two arguments.
The edge direction angle is rounded to one of four angles representing vertical, horizontal and the two diagonals (0, 45, 90 and 135 degrees for example).
 
=== Non-maximum suppression ===
 
Non-maximum suppression is an [[Edge_detection#Edge_thinning|edge thinning]] technique.
 
Given estimates of the image gradients, a search is carried out to determine if the gradient magnitude assumes a local maximum in the gradient direction. In many implementations, the algorithm categorizes the continuous gradient directions into a small set of discrete directions, and then moves a 3x3 filter over the output of the previous step (that is, the edge strength and gradient directions). At every pixel, it suppresses the edge strength of the center pixel (by setting its value to 0) if its magnitude is not greater than the magnitude of the two neighbors in the gradient direction. For example,
* if the rounded gradient angle is zero degrees (i.e. the gradient is in the north-south direction) the point will be considered to be on the edge if its gradient magnitude is greater than the magnitudes at pixels in the '''north and south''' directions,
* if the rounded gradient angle is 90 degrees (i.e. the gradient is in the east-west direction) the point will be considered to be on the edge if its gradient magnitude is greater than the magnitudes at pixels  in the '''east and west''' directions,
* if the rounded gradient angle is 135 degrees (i.e. the gradient is in the north east-south west direction) the point will be considered to be on the edge if its gradient magnitude is greater than the magnitudes at pixels  in the '''north east and south west''' directions,
* if the rounded gradient angle is 45 degrees (i.e. the gradient is in the north west-south east direction) the point will be considered to be on the edge if its gradient magnitude is greater than the magnitudes at pixels  in the '''north west and south east''' directions.
 
Note that the sign of the direction is irrelevant, i.e. north-south is the same as south-north and so on.
 
=== Tracing edges through the image and hysteresis thresholding ===
Large intensity gradients are more likely to correspond to edges than small intensity gradients. It is in most cases impossible to specify a threshold at which a given intensity gradient switches from corresponding to an edge into not doing so.  Therefore Canny uses thresholding with [[hysteresis]].
 
Thresholding with hysteresis requires two thresholds – high and low.  Making the assumption that important edges should be along continuous curves in the image allows us to follow a faint section of a given line and to discard a few noisy pixels that do not constitute a line but have produced large gradients.  Therefore we begin by applying a high threshold.  This marks out the edges we can be fairly sure are genuine.  Starting from these, using the directional information derived earlier, edges can be traced through the image.  While tracing an edge, we apply the lower threshold, allowing us to trace faint sections of edges as long as we find a starting point.
 
Once this process is complete we have a binary image where each pixel is marked as either an edge pixel or a non-edge pixel. From complementary output from the edge tracing step, the binary edge map obtained in this way can also be treated as a set of edge curves, which after further processing can be represented as polygons in the image domain.
 
=== Differential geometric formulation of the Canny edge detector ===
A more refined approach to obtain edges with sub-pixel accuracy is by using the approach of [[Edge detection#Differential edge detection|differential edge detection]], where the requirement of non-maximum suppression is formulated in terms of second- and third-order derivatives computed from a [[scale space]] representation (Lindeberg 1998) – see the article on [[Edge detection#Differential edge detection|edge detection]] for a detailed description.
 
=== Variational formulation of the Haralick–Canny edge detector ===
A variational explanation for the main ingredient of the Canny edge detector, that is,
finding the zero crossings of the 2nd derivative along the gradient direction, was shown
to be the result of minimizing a Kronrod–Minkowski functional while maximizing the integral
over the alignment of the edge  with the gradient field (Kimmel and Bruckstein 2003). See article on
regularized Laplacian zero crossings and other optimal edge integrators for a detailed description.
 
== Parameters ==
The Canny algorithm contains a number of adjustable parameters, which can affect the computation time and effectiveness of the algorithm.
 
* The size of the Gaussian filter: the smoothing filter used in the first stage directly affects the results of the Canny algorithm.  Smaller filters cause less blurring, and allow detection of small, sharp lines.  A larger filter causes more blurring, smearing out the value of a given pixel over a larger area of the image.  Larger blurring radii are more useful for detecting larger, smoother edges – for instance, the edge of a rainbow.
* Thresholds: the use of two thresholds with hysteresis allows more flexibility than in a single-threshold approach, but general problems of thresholding approaches still apply.  A threshold set too high can miss important information.  On the other hand, a threshold set too low will falsely identify irrelevant information (such as noise) as important.  It is difficult to give a generic threshold that works well on all images.  No tried and tested approach to this problem yet exists.
 
== Conclusion ==
The Canny algorithm is adaptable to various environments.  Its parameters allow it to be tailored to recognition of edges of differing characteristics depending on the particular requirements of a given implementation. In Canny's original paper, the derivation of the optimal filter led to a [[Finite Impulse Response]] filter, which can be slow to compute in the spatial domain if the amount of smoothing required is important (the filter will have a large spatial support in that case). For this reason, it is often suggested to use Rachid Deriche's [[infinite impulse response]]  form of Canny's filter (the [[Deriche edge detector|Canny–Deriche detector]]), which is recursive, and which can be computed in a short, fixed amount of time for any desired amount of smoothing. The second form is suitable for real time implementations in [[FPGA]]s or [[Digital signal processor|DSPs]], or very fast embedded PCs. In this context, however, the regular recursive implementation of the Canny operator does not give a good approximation of rotational symmetry and therefore gives a bias towards horizontal and vertical edges.
 
==See also==
*[[Feature detection (computer vision)]]
*[[Feature extraction]]
*[[Scale space]]
*[[Ridge detection]]
*[[Computer vision]]
*[[Digital image processing]]
 
== Suggestions ==
* Canny, J., ''A Computational Approach To Edge Detection'', IEEE Trans. Pattern Analysis and Machine Intelligence, 8(6):679–698, 1986.
* R. Deriche, ''Using Canny's criteria to derive a recursively implemented optimal edge detector'', Int. J. Computer Vision, Vol. 1, pp.&nbsp;167–187, April 1987.
*[http://www.nada.kth.se/cvap/abstracts/cvap191.html Lindeberg, Tony "Edge detection and ridge detection with automatic scale selection", International Journal of Computer Vision, 30, 2, pp 117—154, 1998. (Includes the differential approach to non-maximum suppression.)]
*[http://www.cs.technion.ac.il/~ron/PAPERS/laplacian_ijcv2003.pdf Kimmel, Ron and Bruckstein, Alfred M. "On regularized Laplacian zero crossings and other optimal edge integrators",  International Journal of Computer Vision, 53(3):225-243, 2003. (Includes the geometric variational interpretation for the Haralick-Canny edge detector.)]
 
==External links==
*[http://www.cs.berkeley.edu/~jfc/ John Canny's home page]
*[http://matlabserver.cs.rug.nl/ On-line Canny edge detector]
*[http://www.tomgibara.com/computer-vision/canny-edge-detector Free Java implementation of Canny edge detector]
*[http://www-sop.inria.fr/odyssee/team/Rachid.Deriche/Publications/RD.references.html Publication List of Rachid Deriche]
*[http://www.cs.technion.ac.il/~ron/PAPERS Journal Publications of Ron Kimmel]
*[http://code.google.com/p/in-spirit/wiki/CannyEdgeDetector Canny edge detector implementation in ActionScript for the Flash Platform]
*[http://reference.wolfram.com/mathematica/ref/EdgeDetect.html Canny edge detector in Mathematica]
*[http://www.mathworks.com/discovery/edge-detection.html Canny edge detection using computer algorithms]
*[http://www.edgedetection.webs.com Sobel and Kayyali edge detection comparison]
[[Category:Feature detection]]

Revision as of 12:42, 14 December 2013

Template:FeatureDetectionCompVisNavbox

The Canny edge detector is an edge detection operator that uses a multi-stage algorithm to detect a wide range of edges in images. It was developed by John F. Canny in 1986. Canny also produced a computational theory of edge detection explaining why the technique works.

The Canny edge detector applied to a colour photograph of a steam engine. (See the original image here)

Development of the Canny algorithm

Canny's aim was to discover the optimal edge detection algorithm. In this situation, an "optimal" edge detector means:

  • good detection – the algorithm should mark as many real edges in the image as possible.
  • good localization – edges marked should be as close as possible to the edge in the real image.
  • minimal response – a given edge in the image should only be marked once, and where possible, image noise should not create false edges.

To satisfy these requirements Canny used the calculus of variations – a technique which finds the function which optimizes a given functional. The optimal function in Canny's detector is described by the sum of four exponential terms, but it can be approximated by the first derivative of a Gaussian.

Stages of the Canny algorithm

Noise reduction

The image after a 5x5 Gaussian mask has been passed across each pixel.

Because the Canny edge detector is susceptible to noise present in raw unprocessed image data, it uses a filter based on a Gaussian (bell curve), where the raw image is convolved with a Gaussian filter. The result is a slightly blurred version of the original which is not affected by a single noisy pixel to any significant degree.

Here is an example of a 5x5 Gaussian filter, used to create the image to the right, with = 1.4. (The asterisk denotes a convolution operation.)

Finding the intensity gradient of the image

An edge in an image may point in a variety of directions, so the Canny algorithm uses four filters to detect horizontal, vertical and diagonal edges in the blurred image. The edge detection operator (Roberts, Prewitt, Sobel for example) returns a value for the first derivative in the horizontal direction (Gx) and the vertical direction (Gy). From this the edge gradient and direction can be determined:

,

where atan2 is the arctangent function with two arguments. The edge direction angle is rounded to one of four angles representing vertical, horizontal and the two diagonals (0, 45, 90 and 135 degrees for example).

Non-maximum suppression

Non-maximum suppression is an edge thinning technique.

Given estimates of the image gradients, a search is carried out to determine if the gradient magnitude assumes a local maximum in the gradient direction. In many implementations, the algorithm categorizes the continuous gradient directions into a small set of discrete directions, and then moves a 3x3 filter over the output of the previous step (that is, the edge strength and gradient directions). At every pixel, it suppresses the edge strength of the center pixel (by setting its value to 0) if its magnitude is not greater than the magnitude of the two neighbors in the gradient direction. For example,

  • if the rounded gradient angle is zero degrees (i.e. the gradient is in the north-south direction) the point will be considered to be on the edge if its gradient magnitude is greater than the magnitudes at pixels in the north and south directions,
  • if the rounded gradient angle is 90 degrees (i.e. the gradient is in the east-west direction) the point will be considered to be on the edge if its gradient magnitude is greater than the magnitudes at pixels in the east and west directions,
  • if the rounded gradient angle is 135 degrees (i.e. the gradient is in the north east-south west direction) the point will be considered to be on the edge if its gradient magnitude is greater than the magnitudes at pixels in the north east and south west directions,
  • if the rounded gradient angle is 45 degrees (i.e. the gradient is in the north west-south east direction) the point will be considered to be on the edge if its gradient magnitude is greater than the magnitudes at pixels in the north west and south east directions.

Note that the sign of the direction is irrelevant, i.e. north-south is the same as south-north and so on.

Tracing edges through the image and hysteresis thresholding

Large intensity gradients are more likely to correspond to edges than small intensity gradients. It is in most cases impossible to specify a threshold at which a given intensity gradient switches from corresponding to an edge into not doing so. Therefore Canny uses thresholding with hysteresis.

Thresholding with hysteresis requires two thresholds – high and low. Making the assumption that important edges should be along continuous curves in the image allows us to follow a faint section of a given line and to discard a few noisy pixels that do not constitute a line but have produced large gradients. Therefore we begin by applying a high threshold. This marks out the edges we can be fairly sure are genuine. Starting from these, using the directional information derived earlier, edges can be traced through the image. While tracing an edge, we apply the lower threshold, allowing us to trace faint sections of edges as long as we find a starting point.

Once this process is complete we have a binary image where each pixel is marked as either an edge pixel or a non-edge pixel. From complementary output from the edge tracing step, the binary edge map obtained in this way can also be treated as a set of edge curves, which after further processing can be represented as polygons in the image domain.

Differential geometric formulation of the Canny edge detector

A more refined approach to obtain edges with sub-pixel accuracy is by using the approach of differential edge detection, where the requirement of non-maximum suppression is formulated in terms of second- and third-order derivatives computed from a scale space representation (Lindeberg 1998) – see the article on edge detection for a detailed description.

Variational formulation of the Haralick–Canny edge detector

A variational explanation for the main ingredient of the Canny edge detector, that is, finding the zero crossings of the 2nd derivative along the gradient direction, was shown to be the result of minimizing a Kronrod–Minkowski functional while maximizing the integral over the alignment of the edge with the gradient field (Kimmel and Bruckstein 2003). See article on regularized Laplacian zero crossings and other optimal edge integrators for a detailed description.

Parameters

The Canny algorithm contains a number of adjustable parameters, which can affect the computation time and effectiveness of the algorithm.

  • The size of the Gaussian filter: the smoothing filter used in the first stage directly affects the results of the Canny algorithm. Smaller filters cause less blurring, and allow detection of small, sharp lines. A larger filter causes more blurring, smearing out the value of a given pixel over a larger area of the image. Larger blurring radii are more useful for detecting larger, smoother edges – for instance, the edge of a rainbow.
  • Thresholds: the use of two thresholds with hysteresis allows more flexibility than in a single-threshold approach, but general problems of thresholding approaches still apply. A threshold set too high can miss important information. On the other hand, a threshold set too low will falsely identify irrelevant information (such as noise) as important. It is difficult to give a generic threshold that works well on all images. No tried and tested approach to this problem yet exists.

Conclusion

The Canny algorithm is adaptable to various environments. Its parameters allow it to be tailored to recognition of edges of differing characteristics depending on the particular requirements of a given implementation. In Canny's original paper, the derivation of the optimal filter led to a Finite Impulse Response filter, which can be slow to compute in the spatial domain if the amount of smoothing required is important (the filter will have a large spatial support in that case). For this reason, it is often suggested to use Rachid Deriche's infinite impulse response form of Canny's filter (the Canny–Deriche detector), which is recursive, and which can be computed in a short, fixed amount of time for any desired amount of smoothing. The second form is suitable for real time implementations in FPGAs or DSPs, or very fast embedded PCs. In this context, however, the regular recursive implementation of the Canny operator does not give a good approximation of rotational symmetry and therefore gives a bias towards horizontal and vertical edges.

See also

Suggestions

External links