如何使用Java获取png文件中的文本 [英] How to get text in png file using Java

查看:419
本文介绍了如何使用Java获取png文件中的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检查图像中是否存在特定的字符串.那可能吗? pngj 可以做到吗?

I want to check if particular string is present in the image. Is that possible? Is pngj can do that?

我的文件将包含一个图形和一些图例.我想检查图例是否正确.

My file will contain a graph and some legends. I want to check the if the legends are correct.

推荐答案

不,您不能使用pngj做到这一点.在PNG图像中可见的文本不会在内部存储为文本.如果您希望识别文本,则需要 OCR 软件.

No, you can't do that with pngj. The text that is visible in the PNG image is not internally stored as text. You will need OCR software if you wish to identify the text.

但是,如果能够以另一种更易于计算机解析的格式获取数据,那就更好了.

However it would be much better if you could get the data in another format that is easier to parse by a computer.

这篇关于如何使用Java获取png文件中的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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