0

I am trying to use leptonica API as an OCR pre-processing step for Tesseract. I would like to perform a simple dilation but I don't understand how the structuring element part works in Leptonica. I have found different references on Leptonica but none of them was explaining the functioning of that part of the API.

I would like to do a dilation with a '+' as a structuring element:

| 0 | 1 | 0 |
|---|---|---|
| 1 | 1 | 1 |
|---|---|---|
| 0 | 1 | 0 |

also I am questioning about the use of Leptonica vs hand-crafted processing, as this is quite simple to implement and I don't want to use any other structured element for my morphological processing.

Nick Skywalker
  • 1,027
  • 2
  • 10
  • 26
  • “ I am questioning about the use of Leptonica vs hand-crafted processing” — Never write anew what you can reuse. If you can use an imaging library for this operation, do so. It is always better to have tested and vetted code over possibly buggy, likely suboptimal self-written code that you need to maintain. Don’t waste your time! – Cris Luengo Dec 17 '19 at 13:55
  • Yes you are right. I should have mention that I am targeting an embedded device to make this sound a little more legitimate. – Nick Skywalker Dec 17 '19 at 14:55

0 Answers0