Ask Your Question

How to fill gaps in letters

asked 2017-04-09 14:08:50 -0500

Habib gravatar image

updated 2017-04-10 08:02:42 -0500

Hi i'm new in openCv. i am using OpenCV to process image before sending it to tesseract. but there is gaps in some letters and numbers. How can I fix this?

Thank you.

UPDATE: my process result is this :

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2017-04-10 03:23:58 -0500

It kind of depends on the gaps, can you produce some examples for us? But in general I would look at something like

  • Start by detecting all blobs with findContours.
  • Connect blobs that are close together (dilate and erode are useful here), keeping in mind that blobs split vertically should be merged, but horizontally should be left alone, because then you will connect neighboring letters.

Good luck!

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-04-09 14:07:46 -0500

Seen: 278 times

Last updated: Apr 10 '17