Anonymous user
Canny edge detector: Difference between revisions
m
added whitespace and split some long lines (with equations) into multiple lines.
(Canny edge detector en Java) |
m (added whitespace and split some long lines (with equations) into multiple lines.) |
||
Line 1:
{{task|Image processing}}
{{task|Image processing}}'''Task:''' Write a program that performs so-called [[wp:Canny edge detector|canny edge detection]] on an image.▼
;Task:
▲
A possible algorithm consists of the following steps:
# '''Noise reduction.''' May be performed by [[wp:Gaussian blur|Gaussian filter]].
# Compute '''intensity gradient''' (matrices <math>G_x</math> and <math>G_y</math>) and its '''magnitude''' <math>G</math>
# '''Non-maximum suppression.''' <br>For each pixel compute the orientation of intensity gradient vector: <math>\theta = {\rm atan2}\left(G_y, \, G_x\right)</math>. <br>Transform angle <math>\theta</math> to one of four directions: 0,
# '''Tracing edges with hysteresis.''' <br>At this stage two thresholds for the values of <math>G</math> are introduced: <math>T_{min}</math> and <math>T_{max}</math>. <br>Starting from pixels with <math>N(p) \geqslant T_{max}</math>, find all paths of pixels with <math>N(p) \geqslant T_{min}</math> and put them to the resulting image.
<br><br>
=={{header|C}}==
|