I use this ocr algorithm http://sourceforge.net/projects/javaocr/ to detect numbers in the image. I tried using tesseract, but I had the same problem, sometimes it didnβt work. It never worked (java ocr). When I used java ocr, it did not produce any output except / n.
The image is completely white and the numbers are black. The only artifacts in the image are two lines near the upper and lower borders that do not even interfere with the characters. Alignment is normal, such as typed text, and not handwriting or skew.
BufferedImage image2 = ImageIO.read(new File("moneyImage"+".bmp")); ImageManipulator.show(image2, 5); OCRScanner scanner = new OCRScanner(); String items = scanner.scan(image2, 0, 0, 0, 0, null); System.out.println(items);
Image 2 clearly shows, and this example was taken from someone else who published it as such. I am not doing anything complicated, and it makes no sense to me why this should not work. This is a simple grayscale image.
When I try to run a standalone program (java ocr one), it works and outputs the correct numbers as output. I do not know how to extract characters from my java project and why it does not work.
My test image: 
Also this
String lastText = null; Tesseract instance = Tesseract.getInstance(); try { lastText = instance.doOCR(imageFile); } catch (TesseractException ex) { Logger.getLogger(ActionAbstraction.class.getName()).log(Level.SEVERE, null, ex); }
produces absolutely no output, even if I give an image of a single digit, as deduced from java ocr. They seem to work, but both just don't output anything when I do the actual scan.
In addition, I use tiff images, and as I said before, character extraction works fine. What doesn't work is java code causing the image to scan. I linked the appropriate libraries (or this created compiler errors)