ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / OCR functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns all the text blocks of an image.
Example
MonImage is Image
MonTableauDeBlocsTexte is array of ocrTextBlock
MonTableauDeBlocsTexte = OCRExtractTextBlock(MonImage)
Syntax
<Result> = OCRExtractTextBlock(<Image to use>)
<Result>: Array of ocrTextBlock variables
Array of ocrTextBlock variables.
<Image to use>: Control name, Image variable, character string
Image in which the text blocks must be detected. This image can correspond to:
  • an Image control,
  • an Image variable,
  • an Image Memo item,
  • the path of an image file.
  • the path of PDF file.
    Please note: this file must contain a single page only..
    Reminder: you can extract a page from a PDF file into an image using the PDFExtractPage function. This image can be processed by OCRExtractTextBlock.
Remarks
  • Windows Legacy and LSTM engines can be used in WINDEV applications (Windows and Linux). LSTM models are provided by default.
  • The .traineddata models are required.
  • To get the best results possible, it is recommended to:
    • Use a high-resolution image.
    • Crop the image around the text if possible (avoid unnecessary areas).
    • Limit text skew. If the image is slightly skewed, OCR may be able to detect the text, but the quality will be affected.
    • Limit the number of models/languages used.
  • If the selected area is too small, it will not be possible to retrieve the corresponding text (for example, an area reduced to a single number or letter).
  • Note that, if the image used corresponds to an Image control, the source image will be directly manipulated. Therefore, the changes made in the Image control (image size for example) will not be taken into account. To apply these changes, it is necessary to save the image.
  • Note that, if the image used (via an Image control or not) is a PDF file, its quality will be set to 300 DPI.
  • OCR can only detect printed text. It cannot recognize handwritten text.
  • "White" text is not recognized.
Related Examples:
OCR functions Unit examples (WINDEV): OCR functions
[ + ] This example shows how to use OCR functions in WINDEV.
Business / UI classification: Business Logic
Component: wd300ocr.dll
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help