Note: This document is for an older version of GRASS GIS that is outdated. You should upgrade, and read the current addon manual page.

GRASS logo

NAME

r.smooth.seg - Generates a piece-wise smooth approximation of the input raster and a discontinuity map.

KEYWORDS

raster, segmentation, imagery, edge detection, smoothing

SYNOPSIS

r.smooth.seg
r.smooth.seg --help
r.smooth.seg [-k] in_g=name[,name,...] out_u=name out_z=name [lambda=float] [alpha=float] [mxi=integer] [tol=float] [kepsilon=float] [beta=float] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-k
Activate MSK model (Mumford-Shah with curvature term)
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

in_g=name[,name,...] [required]
Input raster map to segment
out_u=name [required]
Output segmented raster map
out_z=name [required]
Output raster map with detected discontinuities
lambda=float
Smoothness coefficient [>0]
Default: 1.0
alpha=float
Discontinuity coefficient [>0]
Default: 1.0
mxi=integer
Maximal number of numerical iterations
Default: 100
tol=float
Convergence tolerance [>0]
Default: 0.001
kepsilon=float
Discontinuity thickness [>0]
Default: 1.0
beta=float
Curvature coefficient [>=0]
Default: 0.0

Table of contents

DESCRIPTION

r.smooth.seg generates a piece-wise smooth approximation of the input raster map and a raster map of the discontinuities of the output approximation.
The discontinuities of the output approximation are preserved from being smoothed. The values of the discontinuity map are close to one where the output approximation is "homogeneous", where the output approximation has discontinuities (edges) the values are close to zero.
The module makes use of the varseg library which implements the Mumford-Shah [1] variational model for image segmentation. The Mumford-Shah variational model with curvature term [2] is also implemented in the library. The curvature term prevents the discontinuities from being shortened too much when the parameter alpha is set to very high values, (this happens very rarely).
An overview of the underlying theory with some applications can be found in [3].
Other examples of use of the module can be found here and in this presentation [FOSS4G 2009 - pdf].
For details on the numerical implementation see [4].

NOTES

Remove any MASK before the execution of the module.

Replace any NULL data (using r.null) with the map average value (calculate it with r.univar).

The segmentation depends on the parameters alpha and lambda: