Click here to Skip to main content
16,004,991 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
How to convert Image to text in vb.net.
Posted
Updated 18-Apr-11 21:23pm
v2

Incorrect Question. There is no "convert".
(What is that, this misuse of terminology looks pandemic in CodeProject's Inquirers. Who infected it first?!)

This is called OCR — Optical Character Recognition, see http://en.wikipedia.org/wiki/Optical_character_recognition[^], see also: http://en.wikipedia.org/wiki/List_of_optical_character_recognition_software[^]
Quite a difficult topic.

If you can read C# code you can find some solutions you can use in VB.NET. It's hard to find anything which is very good and complete at the same time.

Please look:
Neural Network OCR[^], Creating Optical Character Recognition (OCR) applications using Neural Networks[^], OCR Line Detection[^], Unicode Optical Character Recognition[^] — only those out of some 60 CodeProject search results are real original works you can further develop. You will need to select base method, add or improve training, perform training and store training results, add recognition and alignment of lines, put all together, etc.

It would be great if you have success and share your results.

Also, you can consider .NET wrapper for Tesseract (http://en.wikipedia.org/wiki/Tesseract_(software)[^]) called Tessernet:
http://www.pixel-technology.com/freeware/tessnet2/[^]. I tested it a bit. It is not so good, in my opinion.

—SA
 
Share this answer
 
v4
Comments
Espen Harlinn 19-Apr-11 16:32pm    
Good reply, my 5
Sergey Alexandrovich Kryukov 19-Apr-11 16:48pm    
Thank you, Espen.
--SA
Tarun.K.S 20-Apr-11 2:35am    
Hey congratulations again SA for crossing the 100K mark. It will take me years to get to that level. Cheers!
Sergey Alexandrovich Kryukov 20-Apr-11 12:56pm    
Thank you very much, Tarun.
Score does not matter much but what we do here does!
--SA
Tarun.K.S 20-Apr-11 13:18pm    
And what you do reflects in the score! :D
How about trying this :

VB
Dim sr As New StreamReader("C:\Winter.jpg", Encoding.UTF8)
Dim text As String = sr.ReadToEnd()
Dim sw As New StreamWriter("C:\ImageText.txt", False, Encoding.UTF8)
sw.Write(text)
sw.Close()
sr.Close()


Found another solution here : http://www.codeproject.com/Answers/161703/How-to-convert-image-to-string.aspx#answer1[^]
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 19-Apr-11 16:49pm    
Sense of humor detected! My 5.
--SA
Tarun.K.S 20-Apr-11 2:11am    
Hey it works! Thanks!
Sergey Alexandrovich Kryukov 20-Apr-11 12:49pm    
:-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900