Skip to main content

Image-Form-OCR

Command Description

Use Laiye IDP to recognize multiple tables in the specified image and return result in JSON format

Command Prototype

jsonRet = Mage.ImageOCRTable(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 path of the image to be recognized 
Dim config={"Pubkey":"","Secret":"","Url":""} // Get from mage

TracePrint "--------------------Image table recognition--------------------"
// --------------------------------------------------------
// [Remarks] Image table recognition
// Input parameter 1:
// path--The path of the image to be recognized.Type:String
// 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.ImageOCRTable(path,config, time)
// --------------------------------------------------------

jsonRet = Mage.ImageOCRTable(path,config, 30000)
TracePrint(jsonRet)