Go through the following steps to implement the random walker segmentation with scikit-image functions:
- Again, you first need to create a mask for the input image by (manually) picking a few seed pixels from the foreground (object) and background. For this implementation, the foreground/background seed pixels are marked green and red, respectively. A mask image with the seed pixels marked is provided for the input image to be segmented. First, read the input and mask images:
img = imread('images/earth_by_MCC.png')mask = imread('images/earth_by_MCC_mask.png')
- Extract the object and background seed pixels from the mask image with the following code and create a new marker image in the way that the random_walker function expects ...