Image Transform

Might have a note about this somewhere else?

Source of knowledge:

Euclidean Distance Transform

The distance transform (sometimes called the Euclidean distance transform) replaces each pixel of a binary image with the distance to the closest background pixel. If the pixel itself is already part of the background then this is zero. The result is an image called a distance map.

from scipy.ndimage import distance_transform_edt
from skimage import morphology as morph
 
# Create a small image
bw = np.zeros((9, 9))
bw[4, 4] = 1
bw = morph.dilation(bw, morph.disk(3))
 
# Compute the distance transform
im_dist = distance_transform_edt(bw)

Watershed Transform

To understand how the watershed transform works, picture the image as an uneven landscape in which the value of each pixel corresponds to a height.

You then slowly fill these up.

Voronoi Transform

??