Screen-Stamp-OCR
Command Description
Use Laiye IDP to recognize stamp information in the window. The result will be returned in the form of JSON
Command Prototype
jsonRet = Mage.ScreenOCRStamp(target,rect,config,time)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
target | True | decorator | @ui"" | Use mouse to select or cut off the target screen area including window, elements, range, etc |
rect | True | dictionary | {"height":0,"width":0,"x":0,"y":0} | The range that needs to be searched, the program will recognize in this range of the control, if the range is passed as {"x":0,"y":0,"width":0,"height":0}, then the control rectangle area Recognition within the scope |
config | True | expression | {} | Call configuration of Laiye IDP |
time | True | number | 30000 | Specify the time in milliseconds to wait for a retry to find the text. If exceeded, an error will be thrown. Default: 30,000 milliseconds (30 seconds) |
return
jsonRet,The variable used to save the output of the command.
Demo
Dim rect={"height":0,"width":0,"x":0,"y":0} // Default recognition range
Dim config={"Pubkey":"","Secret":"","Url":""} // Get from mage
TracePrint "--------------------Screen Stamp Recognition--------------------"
// --------------------------------------------------------
// [Remarks] Screen stamp recognition
// Input parameter 1:
// target--target element, this example uses the element in the seal image searched in Baidu
// Input parameter 2:
// rect--recognition range
// Input parameter 3:
// config--mage configuration, need to configure Pubkey and Secret.Type:Dict
// Input parameter 4:
// time--timeout time. Default unit: milliseconds. Type: Int
// Output parameters:
// jsonRet--The variable to which the output of the function call is saved
// Command prototype: jsonRet = Mage.ScreenOCRStamp(target,rect,config,time)
// --------------------------------------------------------
jsonRet = Mage.ScreenOCRStamp(@ui"image<img>1",rect,config,30000)