Usage of CIB modules on Android Technical Guide (EN)

3. SDK

3.4. Recommadation for text recognition

The results of text recognition can be significantly improved with suitable pre-processing of the image data.


Taking the picture

The document should be recorded as flat as possible. Unevenness of the document makes recognition more difficult.


Cleaning the image

Either with a black and white filter like::

CibIpl.localOtsuBinarizer(Bitmap src, float threshold)

or with the following filter, which is also suitable for colour documents:

CibIpl.whiteboard(Bitmap src, boolean reflectionMode)


Aligning the image

The alignment of the document and the text it contains is important. The text should be aligned as horizontally as possible. The alignment is adjusted at the same time as the cut is made by the following function:

CibIpl.warpCrop(Bitmap src, int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, boolean resize)

In addition, an automatic alignment with:

CibIpl.deskew(Bitmap src)

can bring improvements in text recognition.