Tesseract OCR

The Tesseract file stores the functions related tesseract OCR

The source for this file can be found here.

type TTesseractFilter

A record that stores filtering to apply onto a image.

Example:

var
  myTesseractFilter: TTesseractFilter;
begin
  with (myTesseractFilter) do
  begin
    multiplerW := 3;
    multiplerH := 3;

    with (thresholdSettings) do
    begin
      invert := False;
      amount := 20;
      method := TM_Mean;
    end;
  end;

  writeln(Tesseract_GetText(100, 100, 200, 200, myTesseractFilter));
end;

const Tesseract

String constants that store the data path, language and whitelist presets.

Example:

print(TESS_DATA_PATH);

const Filter presets

Constants of TTesseractFilter that are filter presets

Example:

Tesseract_GetText(100, 100, 200, 200, TESS_FILTER_SMALL_CHARS);

_Tesseract_Setup

procedure _Tesseract_Setup();

Setups our instance of tesseract-ocr. Automaticlly called if using functions from this file.

Note

  • by Olly
  • Last updated: 26 July 2014 by Olly

Example:

_Tesseract_Setup();

_Tesseract_Free

procedure _Tesseract_Free();

Frees our instance of tesseract-ocr. Is automaticly called on terminate if _Tesseract_Setup() has been called.

Note

  • by Olly
  • Last updated: 26 July 2014 by Olly

Example:

_Tesseract_Free();

Tesseract_ApplyFilter

procedure Tesseract_ApplyFilter(const BMP: integer; const filter: TTesseractFilter);

Applys the tesseract filter onto the bitmap.

Note

  • by Olly
  • Last updated: 9 September 2014 by Olly

Example:

Tesseract_ApplyFilter(BMP, MyTesseractFilter);

Tesseract_GetText

function Tesseract_GetText(const bmp: integer): string;

Runs tesseract on the bitmap ‘bmp’.

Note

  • by Olly
  • Last updated: 26 July 2014 by Olly

Example:

writeln(Tesseract_GetText(bmp));

Tesseract_GetText; overload

function Tesseract_GetText(const xs, ys, xe, ye: integer; filter: TTesseractFilter): string; overload;

Overloaded method that searches on the client with a filter to read text.

Note

  • by Olly
  • Last updated: 22 January 2016 by Daniel

Example:

writeln(Tesseract_GetText(100, 100, 200, 200, TESS_FILTER_SMALL_CHARS));

Tesseract_GetText; overload

function Tesseract_GetText(const area: TBox; filter: TTesseractFilter): string; overload;

Overloaded method that searches on the client with a filter and accepts a TBox as an area parameter rather than x1, y1, x2, y2.

Note

  • by Olly
  • Last updated: 26 July 2014 by Olly

Example:

writeln(Tesseract_GetText(box, TESS_FILTER_SMALL_CHARS));