code: private String doOCR(IIOImage oimage, String filename, Rectangle rect, int pageNum) throws TesseractException {
          String text = "";
  
          try {
              setImage(oimage.getRenderedImage(), rect);
              text = getOCRText(filename, pageNum);
          } catch (IOException ioe) {
              // skip the problematic image
              logger.warn(ioe.getMessage(), ioe);
          }
  
          return text;
      }
docs: Performs OCR operation.
  <br>
  Note: <code>init()</code> and <code>setTessVariables()</code> must be
  called before use; <code>dispose()</code> should be called afterwards.
  
  @param oimage an <code>IIOImage</code> object
  @param filename input file nam
  @param rect the bounding rectangle defines the region of the image to be
  recognized. A rectangle of zero dimension or <code>null</code> indicates
  the whole image.
  @param pageNum page number
  @return the recognized text
  @throws TesseractException