2012-07-26 96 views
9

我正在尝试使用leptonica处理以下图像以提取带有tesseract的文本。带leptonica的OCR图像处理(反色文本)

原始图像: original image

正方体的原始图像上产生这样的:

i s l 
D2J1FiiE-l191x1iitmwii9 uhiaiislz-2 Q ~37 
Bottom linez 
With a little time! 
you can learn social media technology 
using free online resources- 
And if you donity 
youlll be at a significant disadvantage 
to 
other HOn-pFOiiTS- 

不是很大,尤其是顶部的背景。因此,使用leptionica我使用背景去除算法(模糊,差,阈值,反转),以获得下面的图片: processed image

但正方体不会用它做的工作:

@@r-mair [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]@ll 
mm Mime 
VWU1 a Mitt-Jle time- 
@1m [email protected]@Wn Om @@@lh1 
using free onhne resources- 
Andifyoudoni 
9110 ate a $0 D 
to other non-profrts 
I 

的主要的问题似乎是,现在所有的文字都被概述了,而不是坚实的。如何调整我的算法或我可以添加哪些内容以使文本变为固定?

回答

9

似乎提出了一种解决问题了一个二值化方法:

ŤKasar,J Kumar和A G莱玛克里斯南。 Font and Background Color Independent Text Binarization。 (2007)

Kasar etal method performance

+0

这很好。在我接受答案之前,你不会碰巧知道这个算法的实现吗? – jasonlfunk 2012-08-01 01:45:36

+0

不,不幸的是我不知道是否存在实现。 – sastanin 2012-08-01 16:17:15

+5

我用python和opencv做了一个实现。谢谢! https://github.com/jasonlfunk/ocr-text-extraction – jasonlfunk 2012-08-04 20:37:32