Skip to main content

Extract-the-Seal-Information

Command Description

Extract the specified stamp information from the recognition result. The result is in the form of array

Command Prototype

arrayRet = Mage.ExtractStampInfo(ocrResult,field)

Parameter Description

ParameterRequiredTypeDefaultDescription
ocrResultTrueexpressionjsonRetUse the "Image Stamp OCR", "Screen Stamp OCR" and "PDF Stamp OCR" commands to output the recognition result
fieldTrueenum"text"Extract the follwing fields from stamps: text, color, shape and location

return

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

Demo

Dim jsonRet={"ai_function" : "ocr_stamp","img_id" : "","msg_id" : "58004d488076a4ab52d3dbc5f3451736","stamps" : [{"color" : "OTHERS ","color_description" : "Other","confidence" : 1,"positions" : [{"x" : 3,"y" : 3},{"x"  : 609,"y" : 3},{"x" : 3,"y" : 609},{"x" : 609,"y" : 609}], "shape" : "OTHERS","shape_description" : "other","text" : "XX Technology Co., Ltd."}]}  // Test data 

TracePrint "--------------------Extract stamp information--------------------"
// --------------------------------------------------------
// [Remarks] Extract stamp information
// Input parameter 1:
// ocrResult--seal recognition result
// Input parameter 2:
// field--extract field

// Output parameters:
// arrayRet--The variable to which the output of the function call is saved

// Command prototype: arrayRet = Mage.ExtractStampInfo(ocrResult,field)
// --------------------------------------------------------

arrayRet = Mage.ExtractStampInfo(jsonRet,"text")