使用openCV读取图像中的数字和字母 [英] read numbers and letters from an image using openCV

查看:1292
本文介绍了使用openCV读取图像中的数字和字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,以便使用c ++中的opencv从图像中读取字母和数字.我首先将给定的彩色图像和彩色模板更改为二进制图像,然后将其称为方法cvMatchTemplate().此方法只是突出显示了模板匹配的区域.但是不清楚.我只是不想看到该区域.我需要从图像中解析字符(字母和数字).我是openCV的新手.有人知道其他任何方法来获得结果吗?

I am developing an application to read the letters and numbers from an image using opencv in c++. I first changed the given colour image and colour template to binary image, then called the method cvMatchTemplate(). This method just highlighted the areas where the template matches.. But not clear.. I just dont want to see the area.. I need to parse the characters(letters & numbers) from the image. I am new to openCV. Does anybody know any other method to get the result??

图像是从相机拍摄的.示例图像如上所示.我需要从LED显示屏上获取所有文本(130和Delft Tanthaf).

Image is taken from camera. the sample image is shown above. I need to get all the texts from the LED display(130 and Delft Tanthaf).

我尝试使用面部检测示例应用程序的朋友,它可以检测面部. HaarCascade文件随openCV提供.我刚刚加载了该文件,并调用了方法cvHaarDetectObjects();.为了检测字母,我使用openCV提供的应用程序letter_recog.cpp创建了xml文件.但是当我加载该文件时,它显示了一些错误(OpenCV错误:未指定错误>在未知函数中,文件........ \ ocv \ opencv \ src \ cxcore \ cxpersistence.cpp,第4720行).我在网上搜索了此错误,并获得了有关所用lib文件的信息.我这样做了,但是错误仍然存​​在.我的xml文件或调用方法加载此xml文件是否出错((CvHaarClassifierCascade *)cvLoad(内置的xml文件名",0,0,0);)?请帮助...

Friends I tried with the sample application of face detection, It detects the faces. the HaarCascade file is provided with the openCV. I just loaded that file and called the method cvHaarDetectObjects(); To detect the letters I created the xml file by using the application letter_recog.cpp provided by openCV. But when I loading this file, it shows some error(OpenCV error: UnSpecified error > in unknown function, file ........\ocv\opencv\src\cxcore\cxpersistence.cpp,line 4720). I searched in web for this error and got the information about lib files used. I did so, but the error still remains. Is the error with my xml file or calling the method to load this xml file((CvHaarClassifierCascade*)cvLoad("builded xml file name",0,0,0);)?? please HELP...

预先感谢

推荐答案

从OpenCV 3.0开始(在活动开发环境中),您可以使用内置的场景文本"对象检测模块〜

As of OpenCV 3.0 (in active dev), you can use the built-in "scene text" object detection module ~

示例: https://github.com/Itseez/opencv_contrib/blob/master/modules/text/samples/textdetection.cpp

文本检测基于这两篇论文:

The text detection is built on these two papers:

  • [Neumann12] Neumann L., Matas J.: Real-Time Scene Text Localization and Recognition, CVPR 2012. The paper is available online at http://cmp.felk.cvut.cz/~neumalu1/neumann-cvpr2012.pdf

[Gomez13] Gomez L.和Karatzas D .:多脚本文本提取 《自然风光》,ICDAR2013.本文可在线获得,网址: http://refbase.cvc.uab.es/files/GoK2013.pdf

[Gomez13] Gomez L. and Karatzas D.: Multi-script Text Extraction from Natural Scenes, ICDAR 2013. The paper is available online at http://refbase.cvc.uab.es/files/GoK2013.pdf

一旦找到了场景中文本的位置,就可以对这些切片运行任何类型的标准OCR(Tesseract OCR很常见).现在,使用OpenCV的Tesseract新界面在opencv中提供了一个端到端示例:

Once you've found where the text in the scene is, you can run any sort of standard OCR against those slices (Tesseract OCR is common). And there's now an end-to-end sample in opencv using OpenCV's new interface to Tesseract:

这篇关于使用openCV读取图像中的数字和字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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