Learn R Programming

pliman (version 2.1.0)

dist_transform: Distance map transform

Description

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.

Usage

dist_transform(binary)

Value

An Image object or an array, with pixels containing the distances to the nearest background points

Arguments

binary

A binary image

Examples

Run this code
library(pliman)
img <- image_pliman("soybean_touch.jpg")
binary <- image_binary(img, "B")[[1]]
wts <- dist_transform(binary)
range(wts)

Run the code above in your browser using DataLab