搜索JPEG / BMP / PDF图片为直线,圆和文本 [英] Searching jpeg/bmp/pdf image for straight lines, circles and text

查看:124
本文介绍了搜索JPEG / BMP / PDF图片为直线,圆和文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个图像分析器应读有以下图像:
1.直线
2.圆
3.弧
4.文本

I want to create an image parser that shall read an image having following:
1. Straight Lines
2. Circles
3. Arcs
4. Text

我打开任何类型的图像格式无论是JPEG,BMP或PDF格式的解决方案。

我见过QImage的文档。它应提供给我,我可以在一个二维矩阵的形式存储的像素数据。目前,我认为只有两种颜色黑色和白色。白重presents空像素和黑色重新presents一个绘制像素。

I have seen QImage documentation. It shall provide me with pixel data that I can store in the form of a 2D matrix. At the moment I shall assume that there are only two colours black and white. White represents empty pixel and black represents a drawn pixel.

因此​​,我将有一个稀疏矩阵像

So I will have a sparse matrix like

0 1 1 1 0 0 0
0 0 0 0 0 0 1
0 1 1 0 0 0 1
1 0 0 1 0 0 1
1 0 0 1 0 0 0
0 1 1 0 0 0 0

现在我要脱code这个矩阵,搜索的元素。搜寻在水平和垂直线是容易的,因为每个元件I可以只扫描其相邻行元素和列元素。

Now I want to decode this matrix and search for the elements. Searching for horizontal and vertical lines is easy because for each element I can just scan its neighbouring row elements and column elements.

我如何搜索其他元素(角度线,圆,弧和可能的文字)?

How can I search for other elements (angled lines, circles, arcs and possibly text)?

有关的文字,我读了QImage的有文本()函数,但我不知道它的工作原理是什么类型的输入文件的事情。

For text I read that QImage has text() function but I don't know for what type of input file it works.

有没有办法,我可以考虑任何其他库? 请注意,我只是希望能够读取图像,处理并不需要做的工作。

Is there any other library that I can consider? Please note that I just want to be able to read the image, processing does not need to be done.

有没有我可以做到这一点任何其他方式?还是我太雄心勃勃?

Is there any other way I can accomplish this? Or am I being too ambitious?

感谢

推荐答案

看看的 OpenCV的库。

它提供了大多数的图像检测和愿景和执行code质量使用的标准算法是相当高的一般。

It provides most of the standard algorithms used in image detection and vision and the code quality of its implementation is quite high in general.

不过,这是一般的一个非常棘手的问题,所以你可能需要得到满意的解决方案之前,做研究的相当数量的通知。

Notice though that this is a very difficult problem in general, so you will probably need to do a fair amount of research before getting satisfactory solutions.

这篇关于搜索JPEG / BMP / PDF图片为直线,圆和文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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