Dilate

Perform morphological 'dilation' filtering. Adds pixel in center of the kernel if conditions set in kernel are true.

plantcv.dilate(gray_img, kernel, i)

returns image after dilation

Input grayscale image

Screenshot

from plantcv import plantcv as pcv

# Set global debug behavior to None (default), "print" (to file), or "plot" (Jupyter Notebooks or X11)
pcv.params.debug = "print"

# Perform dilation
# Results in addition of pixels to the boundary of object
dilate_img = pcv.dilate(img, kernel)

Image after dilation

Screenshot