Image Moderation - OCR File Input
傳回影像中針對指定語言找到的任何文字。 如果未在輸入中指定任何語言,則偵測預設為英文。
POST {Endpoint}/contentmoderator/moderate/v1.0/ProcessImage/OCR?overload=stream&language={language}
POST {Endpoint}/contentmoderator/moderate/v1.0/ProcessImage/OCR?overload=stream&language={language}&CacheImage={CacheImage}&enhanced={enhanced}
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
Endpoint
|
path | True |
string |
支援的 Azure 認知服務端點(通訊協定和主機名,例如 https://westus.api.cognitive.microsoft.com)。 |
language
|
query | True |
string |
字詞的語言。 |
Cache
|
query |
boolean |
是否保留提交的影像以供日後使用。 如果省略,預設值為 false。 |
|
enhanced
|
query |
boolean |
當影像設定為 true 時,影像會經歷額外的處理,以隨附其他候選專案。 當增強設定為 true 時,不支援映像或 TIFF 檔案。 注意:這會影響回應時間。 |
要求標頭
Media Types: "image/gif", "image/jpeg", "image/png", "image/bmp", "image/tiff"
名稱 | 必要 | 類型 | Description |
---|---|---|---|
Ocp-Apim-Subscription-Key | True |
string |
要求本文
Media Types: "image/gif", "image/jpeg", "image/png", "image/bmp", "image/tiff"
名稱 | 類型 | Description |
---|---|---|
ImageStream |
object (file) |
圖像檔。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
找到候選文字的文字和清單。 |
|
Other Status Codes |
錯誤回應。 |
安全性
Ocp-Apim-Subscription-Key
類型:
apiKey
位於:
header
定義
名稱 | Description |
---|---|
APIError |
API 傳回的錯誤資訊。 |
Candidate |
光學字元辨識 (OCR) 候選文字。 |
Error |
錯誤本文。 |
Key |
索引鍵/值組物件屬性。 |
OCR |
包含指定語言之影像中找到的文字。 |
Status |
狀態屬性。 |
APIError
API 傳回的錯誤資訊。
名稱 | 類型 | Description |
---|---|---|
Error |
錯誤本文。 |
Candidate
光學字元辨識 (OCR) 候選文字。
名稱 | 類型 | Description |
---|---|---|
Confidence |
number |
置信水準。 |
Text |
string |
找到的文字。 |
Error
錯誤本文。
名稱 | 類型 | Description |
---|---|---|
Code |
string |
|
Message |
string |
KeyValuePair
索引鍵/值組物件屬性。
名稱 | 類型 | Description |
---|---|---|
Key |
string |
索引鍵參數。 |
Value |
string |
Value 參數。 |
OCR
包含指定語言之影像中找到的文字。
名稱 | 類型 | Description |
---|---|---|
CacheId |
string |
快取標識碼。 |
Candidates |
候選文字的清單。 |
|
Language |
string |
ISO 639-3 程式代碼。 |
Metadata |
索引鍵/值組的陣列。 |
|
Status |
評估狀態。 |
|
Text |
string |
找到文字。 |
TrackingId |
string |
追蹤標識碼。 |
Status
狀態屬性。
名稱 | 類型 | Description |
---|---|---|
Code |
integer |
狀態代碼。 |
Description |
string |
狀態描述。 |
Exception |
string |
例外狀況狀態。 |