Package net.sourceforge.tess4j

Examples of net.sourceforge.tess4j.Tesseract


     * @param image An image to be processed by OCR. Should be cropped and filtered to ensure the contrast is sufficient.
     * @return The text that was recognised in the image
     */
    protected String performOcr(BufferedImage image, int iteration) throws OcrException {
        try {
            Tesseract instance = Tesseract.getInstance();
            instance.setPageSegMode(getTesseractPageSegMode(iteration));
            String output = instance.doOCR(image);
            return output.trim();
        } catch (Exception e) {
            throw new OcrException("Error performing OCR", e);
        }
    }
View Full Code Here


   * Processes an images file using Tesseract OCR and returns a boolean given success
   * @param image the image file to process
   * @return true if successful, else false
   */
  public boolean takeImage(File image) {
    Tesseract instance = Tesseract.getInstance();

    try {
      String result = instance.doOCR(image);
      processOCR(result);
      return true;
    }
    catch (TesseractException e) {
      System.err.println(e.getMessage());
View Full Code Here

TOP

Related Classes of net.sourceforge.tess4j.Tesseract

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.