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()); }
| 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
|
UUID getBlockId()
IRecognizedTextPartInfo getRecognitionData()
Rectangle getRectangle()
boolean isToRecognize()
Copyright © 2014. All rights reserved.