distanceTransform | R Documentation |
distanceTransform
calculates the distance to the closest
zero pixel for each pixel of the source image.
distanceTransform(image, distance_type = "L1", mask_size = 3, target = "new")
image |
An |
distance_type |
A character string indicating the type of distance to be calculated. It can be any of the following:
|
mask_size |
A numeric value indicating the size of the distance transform mask. It can be any of the following:
|
target |
The location where the results should be stored. It can take 3 values:
|
If target="new"
, the function returns an Image
object. If target="self"
, the function returns nothing and modifies
image
in place. If target
is an Image
object,
the function returns nothing and modifies that Image
object in
place.
An Image
object.
Simon Garnier, garnier@njit.edu
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
changeColorSpace(balloon, "GRAY", target = "self")
bin <- balloon < 200
dst <- distanceTransform(bin)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.