My task is to perform directional morphological dilation on character, so it produces the horizontal bar for vertical dilation and vertical bar for horizontal dilation.
Where a) is an original character b) after vertical dilation and c) after horizontal dilation.
Below is the code for skimage however it did not produce the result i was expecting for.
from skimage.morphology import dilation, erosion
from skimage.io import imshow, imread, show
import numpy as np
from skimage.filters import threshold_otsu
image = imread('img/A_en.png', as_gray=True)
#binarizing the image
thresh = threshold_otsu(image)
binary = image > thresh
sev = np.ones((20,1)) #20 -row 1-column
seh = np.ones((1,20))
vertical = erosion(binary,sev)
horizontal = erosion(binary, seh)