i.edge is an edge detector based on the Canny edge detection algorithm [Canny1986]. The Canny edge detector is a filter which detects a wide range of edges in raster maps and produces thin edges as a raster map.
An edge is considered as a change in gradient which is computed from image digital values. There are two main noticeable differences between Canny filter and other edge detectors. First, the others algorithm usually output broad lines (edges) while Canny filter outputs one-pixel-wide line(s) which represents the most probable edge position [Russ2011]. Second, the Canny filter combines several steps together while other filters have only one step and often require some pre- or post-processing to get results which allows further processing. However, it must be noted that by applying subsequent filters, thresholding and edge thinning one can get similar results also from other edge detectors. The implementation used for i.edge module is based on code from [Gibara2010].
Canny edge detector is considered as optimal edge detector according to these three criteria [Sonka1999]:
The algorithm consists of a few steps. Firstly, the noise is reduced by a Gaussian filter (based on normal distribution); the result is smoothed image. Secondly, two orthogonal gradient images are computed. These images are combined, so the final gradient can be defined by an angle and a magnitude (value). Next step is non-maximum suppression which preserves only pixels with magnitude higher than magnitude of other pixels in the direction (and the opposite direction) of gradient. Finally, only relevant or significant edges extracted by thresholding with hysteresis. This thresholding uses two constants; if a pixel magnitude is above the higher one (hT), it is kept. Pixels with the magnitude under the lower threshold (lT) are removed. Pixels with magnitude values between these two constants are kept only when the pixels has some neighbor pixels with magnitude higher than the high threshold [Sonka1999].
# set the region (resolution) to Landsat image g.region raster=lsat7_2000_20@landsat # set the region to experimetal area g.region n=224016 s=220981 w=637589 e=641223 # compute PCA for all Landsat maps for year 2002 i.pca input=`g.list pattern="lsat7_2002*" type=rast sep=,` output_prefix=lsat_pca # run edge detection on first component i.edge input=lsat_pca.1@PERMANENT output=lsat_pca_1_edges # set no edges areas to NULL (for visualization) r.null map=lsat_pca_1_edges@PERMANENT setnull=0
Last changed: $Date$