2017-07-03 63 views
2

我是使用谷歌雲API的新手,所以請原諒我,如果我問任何愚蠢的問題。我想嘗試通過Xamarin c#開發android應用程序來爲泰語進行OCR,所以我的想法是,我想從我的照片中獲得OCR結果。 這是我的JSON請求Google雲視覺 - 從OCR請求中獲取JSON錯誤響應

{"requests": [ 
{"image":{"content":"3QGzdykwB2MZPcpx...."}, 
"imageContext": {"languageHints":["th"]}, 
"features": [{"type":"DOCUMENT_TEXT_DETECTION"}]}]} 

但是,我得到的結果是

"error": { 
"code": 14, 
"message": "Service temporarily unavailable. Error processing features."} 

什麼問題呢?任何人都請提出一些建議。謝謝。

+1

得到相同的錯誤...任何分辨率 – Bhuvan

回答

0

因爲你沒有提供的源代碼,讓我假設你正在使用的GoogleCloudPlatform/java-docs-samples

針對上述異常的主要原因是,面對註釋在下面的代碼爲空。您可以根據您的要求更新以下代碼

if (response.getFaceAnnotations() == null) { 
    throw new IOException(
     response.getError() != null 
      ? response.getError().getMessage() 
      : "Unknown error getting image annotations"); 
}