RandomWalk segmentation is an interactive, multilabel image-segmentation method. It starts with a few seed pixels with user-defined labels and then, for each unlabeled pixel, the probability that a random walker starting at that particular pixel will first reach one of the prelabeled pixels is computed. Then the unlabeled pixel is assigned the label corresponding to the higher of the probability values (denoting the probability of reaching first). This results in a high-quality image segmentation. The following figure describes the algorithm steps:
In this recipe, you will learn how to use the scikit-image segmentation module's random walker segmentation implementation function to segment an image, starting from a few seed pixels marking the foreground and background of the image.