Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 11.3   11.4   11.5   12.0   12.1   12.2   12.3   12.4   12.5   13.0    Statistic    FMM    Blog  

OCR.GetTextWithCoordinates

Queries text with coordinates.

Component Version macOS Windows Linux Server iOS SDK
OCR 6.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "OCR.GetTextWithCoordinates" )

Parameters

none

Result

Returns list or error.

Description

Queries text with coordinates.
Please call OCR.Recognize or OCR.GetText or another function first to trigger recognition.

Returns a list with tab separated values. First 4 values define the pixel coordinates. Then followed by style and font size. Finally the word.

Columns: left, top, right, bottom, isBold, isItalic, isUnderlined, isMonospace, isSerif, isSmallCaps, Pointsize, Text.

e.g.
lefttoprightbottomisBoldisItalicisUnderlinedisMonospaceisSerifisSmallCapsPointsizeText
36194912180000007The
1021941772240000007quick
1891942742180000007brown
2871943392250000007dog
3481944562250000007jumped
4682005312180000007over
5401945852180000007the
37228922590000007lazy
1032281532520000007fox.

Examples

Recognize:

#Init OCR
Set Variable [$r; Value:MBS( "OCR.Initialize"; "/Users/cs/Documents"; "eng")]
Set Variable [$rr; Value:MBS( "OCR.SetPageSegMode"; "Auto")]
#Process Image
Set Variable [$img; Value:MBS("GMImage.NewFromContainer"; OCR::Image)]
Set Variable [$r; Value:MBS( "OCR.SetImage"; $img)]
Set Variable [$rr; Value:MBS( "OCR.Recognize")]
Set Field [OCR::Text; MBS("OCR.GetTextWithCoordinates")]
#Cleanup
Set Variable [$r; Value:MBS( "OCR.Cleanup")]
Set Variable [$r; Value:MBS( "GMImage.Release"; $img)]

See also

Created 30th September 2016, last changed 3th April 2021


OCR.GetText - OCR.GetVariable

Feedback: Report problem or ask question.


Start Chat