Distance Transform

Perform distance transform on binary image

distance_transform(img, distanceType, maskSize, device, debug=None)

returns device, distance transformed image normalized between 0 and 1

Input binary image

Screenshot

from plantcv import plantcv as pcv

# Perform dilation
# Results in addition of pixels to the boundary of object
device, distance_transform_img = pcv.distance_transform(mask, 1, 3, device, debug=None)

Image after distance transform

Screenshot