Skip to main content
Version: v6.5.0

Image special OCR recognition

Command Description

Perform special OCR recognition on the specified image, and access to the Internet is required when calling

Command Prototype

sText = OCR.ImageSpecialOCR(sPath,sEngine, sAcessKey, sSecretKey, iTimeOut,sEngineOptionArgs)

Command parameter

parametermandatorytypedefault valueInstructions
sPathTruepath''' C:\Users'''The image path to be recognized
sEngineTrueenum"baidu_webImage"The OCR engine used
sAcessKeyTruestring""ApiKey for OCR Services
sSecretKeyTruestring""Secret Key for OCR Service
iTimeOutTruenumberten thousandSpecifies the amount of time (in milliseconds) to wait for the Activity to run before the SelectorNotFoundException throws an exception. The default value is 10000 milliseconds (10 seconds)
sEngineOptionArgsTrueexpression{}Other attribute of OCR

Return result

SText, Assign the result of running the command to this variable.

Run instance

/**************************Special Image OCR Recognition**************************
Command prototype:
sText = OCR.ImageSpecialOCR('C:\\Users\\', "baidu_webImage", "", "", 10000, {})
Input parameters:
sFileName -- Location of the recognition file. Note: Path of the image to be recognized.
sEngine -- OCR engine. Note: OCR engine used for text recognition.
sAccessKey -- Baidu OCR engine ApiKey. Note: ApiKey for OCR service (need to register OCR account and create application to get this parameter).
sSecretKey -- Baidu OCR engine SecretKey. Note: SecretKey for OCR service (need to register OCR account and create application to get this parameter).
iTimeOut -- Timeout. Note: The amount of time (in milliseconds) to wait for the activity to run before SelectorNotFoundException is thrown. The default value is 10000 milliseconds (10 seconds).
sEngineOptionArgs -- Other attributes. Note: Other attributes of OCR. Type: Dict.
Output parameters:
sText -- The variable where the output of the function call is saved.
Notes:
1. This command calls the external Baidu OCR interface. You need to create a Baidu OCR account and corresponding application in advance, and obtain the corresponding Access Key and Secret Key of the application.
2. Ensure that the window for OCR operation exists; otherwise, the command execution will report an error.
3. An external network connection is required to run this command.
******************************************************************/

Dim sText = ""
sText = OCR.ImageSpecialOCR(@res"1643099897(1).jpg","baidu_webImage", "P10qsjDcuoN5ZU7dnSHmXzGh", "Fm8whYrNnXtKkSvqVPUYL573XfNbxlmO", 10000,{})
TracePrint(sText)