distmap {EBImage} | R Documentation |
Distance map transform of binary images.
distmap(x, tolerance=0.05, minBG=0.05, strict=FALSE, ...)
x
Image-class
in the
Grayscale
mode. tolerance
[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
sctrict
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. ...
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) )
.
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.
Copyright (c) 2005-2006 Oleg Sklyar : osklyar@ebi.ac.uk
ImageMagick: http://www.imagemagick.org.
Image-class, watershed, thresh
## Not run: see ?watershed for examples