com.aspose.ocr

## Interface IRecognitionBlock

-     public interface IRecognitionBlock

  This interface represents a block.

  Block is a rectangular region that may contain text, picture or any other data. OCR Engine will recognize whole image and will try to find text blocks by itself, if blocks are not specified by user.

  >      OcrEngine ocr = new OcrEngine();
  >      ocr.setImage(ImageStream.fromFile("image.tiff"));
  >      ocr.getLanguages().addLanguage(Language.load("english"));
  >      IRecognitionBlock pictureBlock = RecognitionBlock.createPictureBlock(0, 0, 100, 200);
  >      ocr.getConfig().addRecognitionBlock(pictureBlock);
  >      IRecognitionBlock textBlock = RecognitionBlock.createTextBlock(110, 210, 100, 100);
  >      ocr.getConfig().addRecognitionBlock(textBlock);
  >      if (ocr.process()) {
  >          System.out.println(textBlock.getRecognitionData().getText());
  >      }

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `UUID` | `getBlockId()` Returns the block's ID.
    `IRecognizedTextPartInfo` | `getRecognitionData()` Gets the recognition data.
    `Rectangle` | `getRectangle()` Returns the rectangle that defines recognition block inside specified image
    `boolean` | `isToRecognize()` Shows if block needs to be processed by OCR Engine

- - ### Method Detail

    - #### getBlockId

          UUID getBlockId()

      Returns the block's ID. Each block has unique ID. Sets when the block is created.
      Returns:
        The block's ID

    - #### getRecognitionData

          IRecognizedTextPartInfo getRecognitionData()

      Gets the recognition data.
      Returns:
        The recognition data.

    - #### getRectangle

          Rectangle getRectangle()

      Returns the rectangle that defines recognition block inside specified image
      Returns:
        the rectangle that defines recognition block inside specified image

    - #### isToRecognize

          boolean isToRecognize()

      Shows if block needs to be processed by OCR Engine
      Returns:
        true if block needs to be processed by OCR Engine

Copyright © 2014. All rights reserved.