View source: R/utils_segmentation.R
dist_transform | R Documentation |
Computes the distance map transform of a binary image. The distance map is a matrix which contains for each pixel the distance to its nearest background pixel.
dist_transform(binary)
binary |
A binary image |
An Image
object or an array, with pixels containing the distances
to the nearest background points
if (interactive() && requireNamespace("EBImage")) {
library(pliman)
img <- image_pliman("soybean_touch.jpg")
binary <- image_binary(img, "B")[[1]]
wts <- dist_transform(binary)
range(wts)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.