java - Tesseract OCR not working in Web Project -


i'm trying use tesseract ocr in web application. code runs fine when run java application. put same code in web application, doesn't work anymore. if put function in servlet, tomcat doesnt start @ all. if call separate class creating object, on debugging find object not created @ all. have included jars necessary.

code in servlet

ocrfulltrial ot = new ocrfulltrial(); ot.imgocr(); 

inside other class

public void imgocr(){     file imagefile = new file("d:\\ocrtesting\\0.jpg");  try {      itesseract instance = new tesseract();  //                 system.out.println("1");  } catch (exception e) {     system.err.println(e.getmessage()); } 

just pointers think should check, in case if using tess4j in web based project:

1) put jars in web-inf > lib folder. 2) *.dll files provided along tess4j must in system32 folder (windows). don't know other os. 3) set instance path using instance.setdatapath() method. must point folder containing tessdata folder.  4) set language using instance.setlanguage() incase tessdata has multiple languages training data in them. 

crosscheck above steps , try running again. hope works


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -