Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5   8.6    Statistic  

OCR.GetText

Returns recognized text.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
OCR 2.9 Yes Yes Yes Yes Yes
MBS( "OCR.GetText" )   More

Parameters

none

Result

Returns the text.

Description

Returns recognized text.
Calls Recognize if needed internally.

Examples

Query text:

$text = MBS( "OCR.GetText" )

Custom function to read image and return text:

/*
MBS-OCR ( language; Image)

Requires tessdata resources [MIT ©]
language: deu ('deu.traineddata), fra, eng, etc.
Image: Container Fieldname ('MyTable::MyField') in Quotes
path: FM/Extensions - put 'tessdata' Folder into FM Extensions Folder

Benjamin Fehr, EfficientBizz GmbH
http://www.efficientbizz.com
*/

Let (
[

// init OCR
    $path = MBS ("Path.FileMakerPathToNativePath"; Get(FileMakerPath)& "Extensions/") ;
    initialize = MBS( "OCR.Initialize"; $path; language) ; $Error = initialize ;
    SegMode = MBS( "OCR.SetPageSegMode"; "Auto");

// Process Image
    $img = MBS("GMImage.NewFromContainer"; Image);
    set = MBS("OCR.SetImage"; $img) ;
    $result = MBS("OCR.GetText") ;


// Cleanup
    $clean = MBS( "OCR.Cleanup") ;
    $destroy = MBS( "GMImage.Destroy"; $img)


]
; "" )

See also

Example Databases

Created 18th August 2014, last changed 23th April 2018


OCR.GetPageSegMode   -   OCR.GetTextWithCoordinates

Feedback: Report problem or ask question.




Links
MBS Xojo PDF Plugins