在此分析的基础上对图像进行分析和转换以获得更好的OCR结果 [英] Analysis and transformation of the image on the basis of this analysis for better OCR results

查看:82
本文介绍了在此分析的基础上对图像进行分析和转换以获得更好的OCR结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个OCR项目,但是它仅适用于文本相当笔直而不是上下颠倒的图像. (非旋转文字) 因此,我想使OCR能够识别任何类型的图像,甚至可以颠倒过来.但是我不知道有什么方法可以解决这个问题.

I have an OCR project, but it works good only with images in which the text is fairly straight, not upside down. (not rotated text) So I want to make OCR to be able to recognize any kind of images, even upside down. But I don't know what are approaches to solve this problem.

我需要类似字母行的分析,但是即使那样我也无法确定行是否上下颠倒.

I need something like analysis of lines of letters, but even then I can't identify if line is upside down or not.

推荐答案

如果要执行OCR的图像来自杂志或书籍,其中多行上有很多文本,则建议尝试查找页面.

If the images you are performing OCR on are from a magazine or book where there is lots of text on multiple lines, I suggest trying to find the rotation of the page.

可能最简单的方法是对行应用霍夫变换.由于每行文本之间的空白应该是一条宽白线,因此无需对图像进行任何预处理就可以正常工作.否则,请尝试使其模糊或使用关闭"形态学操作将文本行变成不透明块.

Probably the simplest way to do this is applying the hough transform for lines. Since the empty space between each line of text should be a a broad white line this could work without any preprocessing of the image. Otherwise try blurring it or using the "close" morphological operation to make the lines of text into opaque blocks.

使用霍夫变换在图像中找到线条后,应该提取旋转的主角度(如所有线条的平均角度)并将其旋转回去.

Once you find the lines in the image with the hough transform you should just extract the principal angle of rotation (like the mean angle of all lines) and rotate it back.

这篇关于在此分析的基础上对图像进行分析和转换以获得更好的OCR结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆