在.jpg / .png等图像文件中搜索文本 [英] Search Text In Image files like .jpg/.png

查看:103
本文介绍了在.jpg / .png等图像文件中搜索文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



在我的项目中,我需要搜索包含jpg和png扩展名的图像文件夹中的特定文本。

注意:我只需要c#代码

请帮助我非常需要!!!

在此先感谢。

解决方案

你需要做的事情取决于文本的位置:如果它是文件名,那那就非常简单了。 />
如果它在图像本身,那真的非常复杂,并且意味着首先在图像上使用一些OCR软件来识别任何文本,然后搜索它。有一个开源OCVR库的库,其中一些有.NET包装器 - Googleopen OCR C# [ ^ ]是您开始寻找的最佳位置,但不要期望这是一个五分钟的工作,或者让代码准备好做你想要的(也许,不要指望结果也能快速运行!)


看看这些链接试试任何一个如果实现的话仍然你遇到任何问题发布它阅读文字来自C#.net 中的图片

C#Imaging - C#.NET中的OCR识别


嗨试试这个



  string  path =  @  d:\Images; 
DirectoryInfo di = new DirectoryInfo(path);
FileInfo [] fi = new string [] { * .jpg * .png} .SelectMany(i = > di.GetFiles(i,SearchOption.AllDirectories))。Distinct()。ToArray() ;
string [] filenames = fi.Select(k = > k.Name)。 ToArray的();


Hi friends,

In My project i need to search for specific text in a folder that conatains image with extension jpg and png.
note: I need only c# code for this
please help i need it very badly!!!
Thanks in advance.

解决方案

Exactly what you need to do is dependant on where the text is: if it is in teh file name, then that's pretty trivial.
If it's in the image itself, then that's really quite complex, and means using some OCR software on the image first to identify any text and then search that. There are a coupel of open-source OCVR libraries, some of which have .NET wrappers - Google "open OCR C#[^] is the best place for you to start looking, but dontt expect this to be a five minute job, or to get code ready to do exactly what you want (and probably, don't expect the results to be quick to run either!)


see these Links Try any one to implement if still you are facing any problem post it Read Text from Image in C#.net
C# Imaging - OCR Recognition in C#.NET


Hi Try this

string path = @"D:\Images";
           DirectoryInfo di = new DirectoryInfo(path);
           FileInfo[] fi = new string[] { "*.jpg", "*.png" }.SelectMany(i => di.GetFiles(i, SearchOption.AllDirectories)).Distinct().ToArray();
           string[] filenames = fi.Select(k => k.Name).ToArray();


这篇关于在.jpg / .png等图像文件中搜索文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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