简体   繁体   English

使用OpenCV从图像中提取数字

[英]Extracting Numbers from an Image using OpenCV

I have Images like these from which I want to extract the Numbers. 我有像这样的图像,我想从中提取数字。

在此输入图像描述在此输入图像描述

I've been working with OpenCV and Template Matching in particular Interested me, but as the technique doesn't account for any image scaling and rotation, I'm out looking for techniques that may be able to take atleast scaling into account. 我一直在使用OpenCV和模板匹配特别感兴趣,但由于该技术不考虑任何图像缩放和旋转,我正在寻找可能能够考虑至少扩展的技术。

Please offer any suggestion or help. 请提供任何建议或帮助。 All operation are in Real Time. 所有操作都是实时的。

PS Image quality cannot be improved, The camera's capability is as such. PS图像质量无法提高,相机的功能就是这样。

To detect these numbers without using SIFT or SURF it is also possible to create a classifier based on the K nearest Neighbour algorithm. 为了在不使用SIFT或SURF的情况下检测这些数字,还可以基于K最近邻居算法创建分类器。 You can generate a database of .pbm files and load them into a classifier using a c++ OCR library found here 您可以生成.pbm文件的数据库,并使用此处的c ++ OCR库将它们加载到分类器中

Step by step: 一步步:

1: Find a way to extract the numbers from the image using cvFindContours 1:找到一种使用cvFindContours从图像中提取数字的方法

2: Store these images as png files with cvSaveImage and convert them to binary pbm files 2:使用cvSaveImage将这些图像存储为png文件,并将它们转换为二进制pbm文件

3: Number the .pbm files and store them in seperate folders for each number 3:为.pbm文件编号并将它们存储在每个数字的单独文件夹中

4: Load the .pbm files with the library shown above 4:使用上面显示的库加载.pbm文件

5: Use the function ocr::classify with the images in real time to get the category they belong to (eg which number). 5:使用函数ocr::classify与图像实时获取它们所属的类别(例如,哪个数字)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM