使用OpenCV,如何在执行OCR之前检测文本方向? [英] Using OpenCV, how can I detect text orientation before performing OCR?

查看:836
本文介绍了使用OpenCV,如何在执行OCR之前检测文本方向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iOS应用程序中使用OpenCV.我想对某些文本执行OCR,但是我首先需要确定其方向.

I'm using OpenCV within an iOS application. I'd like to perform OCR on some text, but I first need to determine its orientation.

我该如何在OpenCV中做到这一点?

How do I do that in OpenCV?

推荐答案

我不确定在没有Objective-C中提供OCR的情况下是否可以回答这个问题-如果不使用,很难在几行文本中完成一个OCR库.

I am not sure that one can reply to the question without providing OCR in Objective-C - something that can hardly be done in a few lines of text without using an OCR library.

好吧,二十年前,我编写了一个OCR系统(不使用任何OCR库)来实时读取银行支票.顺便说一句,它还可以对手写签名进行身份验证.

Well, 20 years ago, I wrote an OCR system (without using any OCR library) to read bank checks in real-time. It was also authentifying hand-written signatures by the way.

检查方向的问题很严重,因为支票可以(由人工操作)随机插入小型电动银行支票扫描仪中.

The problem of checking the orientation was pregnant because checks could be inserted randomly (by human operators) in the small motorized bank-check scanner.

由于所有银行都使用不同的页面布局和装饰,因此唯一不依靠磁性墨水(扫描仪无法检测到)的方向来找到方向的唯一方法是实际上尝试对位于页面顶部的第一个字符进行OCR识别. 页面".

Since all banks were using different page layouts and decorations, the only way to find the orientation without relying on magnetic ink (that the scanner did not detect) was to actually attempt an OCR recognition on the first characters found at the top of the 'page'.

有些字符像"O"一样模棱两可,但是大多数其他字符会告诉您图片是反转还是镜像,因此只需阅读前3-5个字符即可完成工作(除非您有重复).

Some charcters are ambiguous like an 'O' but most others will tell you if the picture is inverted or mirrored so just reading the first 3-5 charcters will do the job (unless you have repetitions).

祝你好运!

这篇关于使用OpenCV,如何在执行OCR之前检测文本方向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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