Skip to main content

Image-Custom-Template

Command Description

Use Laiye IDP to identify content of specified image custom template, and return results in JSON format

Command Prototype

jsonRet = Mage.ImageOCRTemplate(path,config,time)

Parameter Description

ParameterRequiredTypeDefaultDescription
pathTruepath'''C:\Users'''Paths of images in jpeg, jpg, png, bmp, tif, tiff and other formats are supported to be identified. Only homepage recognition is supported for PDF files
configTrueexpression{}Call configuration of Laiye IDP
timeTruenumber30000Specify the waiting time in milliseconds. If exceeded, an exception will be thrown. Default: 30,000 milliseconds (30 seconds)

return

jsonRet,The variable used to save the output of the command.

Demo

Dim path=''''''  //  The image path to be recognized 
Dim config={"Pubkey":"","Secret":"","Url":""} // Obtained from mage, you need to create the corresponding model in "Custom Template Recognition" first

TracePrint "--------------------Image custom template recognition--------------------"
// --------------------------------------------------------
// [Remarks] Image custom template recognition
// Input parameter 1:
// path--The path of the image to be recognized
// Input parameter 2:
// config--mage configuration, need to configure Pubkey and Secret.Type:Dict
// Input parameter 3:
// 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.ImageOCRTemplate(path,config,time)
// --------------------------------------------------------

jsonRet = Mage.ImageOCRTemplate(path,config,30000)
Traceprint(jsonRet)