2

I'm writing code that should detect Hebrew letters. This is my initial image:

enter image description here

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:

enter image description here

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:

enter image description here

and:

enter image description here

separately.

important comment:

In this case the letters were connected vertically. They can be horizontally connected as well. Any help will be appreciated!

Binyamin Even
  • 3,318
  • 1
  • 18
  • 45
  • where did you get that "initial image"? maybe you can improve something int he steps befor? you could simply omit small components . I don't know Hebrew but I guess you don't need those small dots. other than that, why do you detect letters using this approach? – Piglet Jul 03 '20 at 15:29
  • You can try iterations number change. Try iterations=1 or iterations=2. – Alex Alex Jul 04 '20 at 16:47

0 Answers0