OCR in JAVA
I need the smallest program ever of OCR.....i.e. which takes an img as input and gives characters as output...........I really need this program....
System.load("E:/OCR/ocr-eval-java-Windows/DevIL.dll");
System.load("E:/OCR/ocr-eval-java-Windows/ILU.dll");
System.load("E:/OCR/ocr-eval-java-Windows/AspriseOCR.dll");
BufferedImage image = ImageIO.read(new File("ocr.gif"));
s = new OCR().recognizeCharacters(image);
this is not working as its giving this error
java.lang.UnsatisfiedLinkError: no AspriseOCR in java.library.path
plz help needed!!!!!!!!All developers of JAVA
Thanx in advance!
os: windows xp
system path is set
class path is set
IDE:- eclipse 3.1
When I run the following program I get the error given below:
Source Code:-
package src.main.java.TextExtractionAction;
import com.asprise.util.ocr.OCR;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
public class Demo {
/**
* @param args
*/
public static void main(String[] args) {
BufferedImage image;
String imageLocation = "ocr.gif";
try {
image = ImageIO.read(new File(imageLocation));
// recognizes both characters and barcodes
String s = new OCR().recognizeEverything(image);
// prints the results.
System.out.println("RESULTS: \n" + s);
} catch(IOException e) {
e.printStackTrace();
}
}
}
Stack trace:
java.lang.UnsatisfiedLinkError: C:\Program Files\Java\j2re1.4.2_03\bin\AspriseOCR.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.asprise.util.ocr.OCR.loadLibrary(OCR.java:247)
at com.asprise.util.ocr.OCR.<init>(OCR.java:56)
at src.main.java.TextExtractionAction.Demo.main(Demo.java:28)
Exception in thread "main"
Can anyone help me solve this issue
First of all, did you know you just responded to a message from October 2006?
If you have your own question, you should post a new message.
But, anyway...
> java.lang.UnsatisfiedLinkError: AspriseOCR.dll: Can't find dependent libraries
That means your program was able to find AspriseOCR.dll,
but AspriseOCR.dll needs other DLLs, and your program could not find those.
You need to examine AspriseOCR.dll to see what other DLLs it depends on,
and include those DLLs with your program also.