PDA

View Full Version : How to read text from image?


pashah72
09-21-2005, 03:11 PM
Hello :confused:

I have a text which is embeded inside an image. I need to read text from Image. How to to do it? Below file(File.java) reads image file but how to read text from image? I am using java?

import java.io.*;
class File {
public static void main(String args[])
{
File f1=new File("c:\\java","abc.jpg");
System.out.println("File Name:"+f1.getName());
}
}

Looking forward for an early reply.
Thanks.

nikkiH
09-21-2005, 11:15 PM
If this were easy to do, all those images on registration and mail forms to prevent bots from using them wouldn't be too good, would they?

Generally speaking, it can't be done. You could try, but it will always just be guessing based on pixels and colorization and whatnot.
It certainly won't be a simple one-method solution.

JamieR
09-22-2005, 10:22 PM
So basically you need some implementation of OCR?

nikkiH
09-23-2005, 03:59 PM
IME such software needs high resolution images with good color contrast to be any good.
Works great with stuff like book and newspaper scans.
Not so good with web images. Too compressed.

Get a trial version before you buy anything. :D

pashah72
09-24-2005, 02:09 PM
Hello,

I got a site www.javaocr.com but it reads text from white background only & text should be black only that is black txt on white bg but my image doesn't have white bg or black txt, what to do?