ImageEn, unit ievision

TIEVisionOCR.getRegions

TIEVisionOCR.getRegions


Declaration

function getRegions(textOnly: bool32 = false): TIEVisionVectorRect; overload; safecall;
function getRegions(image: TIEVisionImage; textOnly: bool32 = false): TIEVisionVectorRect; overload; safecall;


Description

Detects text regions (layout).
First overload takes last processed image as input.
Second overload takes the specified image as input.

Parameter Description
image Source image.
textOnly If true then returns only text regions.

Notes:
- getRegions should be used with the ievOCRAuto_Only or ievOCRAuto segmentation modes
- You can draw the rects to canvas using DrawRects


Example

OCR.setSegmentationMode(ievOCRAuto);
regions := OCR.getRegions(image);
for i := 0 to regions.size()-1 do
  with regions.getRect(i) do
  begin
    str := m_OCR.recognize(image, IEVisionRect(x, y, width, height));
  end;