distmap {EBImage} | R Documentation

## Distance map transform of binary images

### Description

Distance map transform of binary images.

### Usage

        distmap(x, tolerance=0.05, minBG=0.05, strict=FALSE, ...)

### Arguments

`x`
  An object of `Image-class` in the `Grayscale` mode.
`tolerance`
  A numeric value in the range `[0,1)`. Image pixels that differ from background (zero) by less than this value will be considered as background. This enables image-wide single value threshloding if necessary.
`minBG`
  An estimated minimum fraction of background. If the estimated number of background pixels is smaller than this value the algorithm will terminate to avoid unnecessarily lengthy computations. This is a protection mechanism in case a very noise image is supplied without first thresholding it.
`sctrict`
  If `TRUE`, single-pixel diagonal distances are calculated exactly (i.e. `sqrt(2)`), otherwise these are set to be 1, same as neighbouring pixels on the vertical and horizontal axes.
`...`
  Reserved for future use.

### Value

An object of `Image-class` in the `Grayscale` mode with pixels containing `floor` of distances to the nearest background. If `strict` is set to `TRUE`, single-pixel diagonal distances are calculated exactly (i.e. `sqrt(2)`), otherwise these are set to be 1, same as neighbouring pixels on the vertical and horizontal axes.To preview the results visually, use `display( normalize(result) )`.

### Details

Given a binary or grayscale image with zero background, a distance map transformed image contains in each pixel a distance to the closest background pixel (zero). This function is used extensively in object detection. Distance map is a usual input for `watershed` and other segmentation algorithms that are used to identify and separate closely positioned objects.

### Author(s)

Copyright (c) 2005-2006 Oleg Sklyar : osklyar@ebi.ac.uk

### References

ImageMagick: http://www.imagemagick.org.

### See Also

`Image-class, watershed, thresh`

### Examples

      ## Not run: see ?watershed for examples

[Package EBImage version 2.0.1 Index]