本文介紹視覺智能開放平臺(tái)通過配置審計(jì)接入,作為事件源發(fā)布到事件總線EventBridge的事件類型。
事件類型
視覺智能開放平臺(tái)支持發(fā)布到事件總線EventBridge的事件類型如下所示。
事件類型 | type參數(shù)值 |
---|---|
通用文字識(shí)別 | viapi:ocr:RecognizeCharacter |
視頻文件通用文字識(shí)別 | viapi:ocr:RecognizeVideoCharacter |
CloudEvents規(guī)范中定義的參數(shù)解釋,請(qǐng)參見事件概述。
通用文字識(shí)別
通用文字識(shí)別時(shí),事件總線EventBridge接收到的示例事件如下所示。
{
"id": "25da3c42-0caa-4259-****-50d4c189f12b",
"source": "acs.viapi",
"specversion": "1.0",
"type": "viapi:ocr:RecognizeCharacter",
"datacontenttype": "application/json;charset=utf-8",
"subject": "acs.viapi:cn-shanghai:1056067501*****:Request/6DE1D35C-2ED2-5FDC-*****-D2311A1C6932",
"time": "2021-09-28T02:27:42.089Z",
"aliyunaccountid": "1056067501*****",
"aliyunpublishtime": "2021-09-28T02:27:42.115Z",
"aliyunoriginalaccountid": "1056067501*****",
"aliyuneventbusname": "default",
"aliyunregionid": "cn-shanghai",
"data": {
"httpCode": "200",
"jobId": "6DE1D35C-2ED2-5FDC-12DC-D2311A1C****",
"ossFile": "oss://viapi-test/test/objectdet/DetectIPCObject/test***.jpeg",
"requestId": "6DE1D35C-2ED2-5FDC-12DC-D2311A1C****",
"result": "{\"Results\":[{\"Probability\":0.95983,\"TextRectangle\":{\"Angle\":0,\"Left\":50,\"Top\":50,\"Width\":100,\"Height\":40},\"Text\":\"文字內(nèi)容\"},{\"Probability\":0.95983,\"TextRectangle\":{\"Angle\":10,\"Left\":50,\"Top\":50,\"Width\":100,\"Height\":40},\"Text\":\"文字內(nèi)容\"}]}",
"status": "PROCESS_SUCCESS"
}
}
data字段包含的參數(shù)解釋如下表所示。
參數(shù) | 類型 | 示例值 | 描述 |
---|---|---|---|
httpCode | String | 200 | 業(yè)務(wù)方的HttpCode。 |
jobId | String | 6DE1D35C-2ED2-5FDC-12DC-D2311A1C**** | 執(zhí)行任務(wù)的ID。 |
ossFile | String | oss://viapi-test/test/objectdet/DetectIPCObject/test***.jpeg | OSS文件地址。 |
requestId | String | 6DE1D35C-2ED2-5FDC-12DC-D2311A1C**** | 執(zhí)行任務(wù)的請(qǐng)求ID。 |
result | String | {\"Results\":[{\"Probability\":0.95983,\"TextRectangle\":{\"Angle\":0,\"Left\":50,\"Top\":50,\"Width\":100,\"Height\":40},\"Text\":\"文字內(nèi)容\"},{\"Probability\":0.95983,\"TextRectangle\":{\"Angle\":10,\"Left\":50,\"Top\":50,\"Width\":100,\"Height\":40},\"Text\":\"文字內(nèi)容\"}]} | 結(jié)果數(shù)據(jù)。 |
status | String | PROCESS_SUCCESS | 任務(wù)處理結(jié)果狀態(tài)。 |
視頻文件通用文字識(shí)別
視頻文件通用文字識(shí)別時(shí),事件總線EventBridge接收到的示例事件如下所示。
{
"id": "25da3c42-0caa-4259-****-50d4c189f12b",
"source": "acs.viapi",
"specversion": "1.0",
"type": "viapi:ocr:RecognizeVideoCharacter",
"datacontenttype": "application/json;charset=utf-8",
"subject": "acs.viapi:cn-shanghai:1056067501*****:Request/6DE1D35C-2ED2-5FDC-*****-D2311A1C6932",
"time": "2021-09-28T02:27:42.089Z",
"aliyunaccountid": "1056067501*****",
"aliyunpublishtime": "2021-09-28T02:27:42.115Z",
"aliyunoriginalaccountid": "1056067501*****",
"aliyuneventbusname": "default",
"aliyunregionid": "cn-shanghai",
"data": {
"httpCode": "200",
"jobId": "6DE1D35C-2ED2-5FDC-****-D2311A1C6932",
"ossFile": "oss://viapi-test/test/objectdet/DetectIPCObject/test***.jpeg",
"requestId": "6DE1D35C-2ED2-5FDC-****-D2311A1C6932",
"result": "{\"Width\":1920,\"height\":1080,\"Frames\":[{\"Timestamp\":1,\"Elements\":[{\"Score\":0.95983,\"TextRectangle\":{\"Angle\":0,\"Left\":50,\"Top\":50,\"Width\":100,\"Height\":40},\"Text\":\"文字內(nèi)容\"},{\"Score\":0.95983,\"TextRectangle\":{\"Angle\":10,\"Left\":50,\"Top\":50,\"Width\":100,\"Height\":40},\"Text\":\"文字內(nèi)容\"}]}]}",
"status": "PROCESS_SUCCESS"
}
}
關(guān)于data字段包含的參數(shù)解釋,請(qǐng)參見參數(shù)解釋。