Perform the following steps to separate drawing from text using dilation by reconstruction using the skimage library functions:
- Read the input image (Tagore's drawing-ridden Bengali manuscript of one of his songs in his own handwriting) and convert it into a binary image with thresholding followed by binary inversion (you want to have the alphabets as foreground objects, that is, in white):
img = rgb2gray(imread('images/tagore_manuscript.jpg'))th = 0.6 #threshold_otsu(img)img[img <= th] = 0img[img > th] = 1img = 1 - img
- The mask image required for reconstruction by dilation is simply the binary image obtained previously. Create the seed image (reconstruction by dilation) using the binary_erosion ...