I'm writing code that should detect Hebrew letters. This is my initial image:
The 2 letters (ע and נ) are connected, and thus I can't identify them correctly.
So I use dilation to separate them:
ker = np.ones((2, 2), np.uint8)
dilated_img = cv2.dilate(ci.astype('uint8'), ker, iterations=3)
After the dilation the image looks like that:
The problem with the second image is that the dilation caused to more than 2 connected components. So my question is how could I take separately the 2 images of the letters, with the additional black components that were added due to the dilation process.
so what I need to take is:
and:
separately.
important comment:
In this case the letters were connected vertically. They can be horizontally connected as well. Any help will be appreciated!