【发布时间】:2018-05-14 04:37:27
【问题描述】:
我使用 Google vision API 从任何对象(如报纸或墙上的文字)中读取文本。我从 Google 开发者网站尝试过相同的示例,但我的文本识别器总是在 IsOperational 函数上返回 false。我在 Blackberry keyone 上进行了测试,也在 Moto x 上进行了测试,运行良好。
Gradle 文件:
compile 'com.google.android.gms:play-services-vision:11.0.4'
谁能帮我解决这个问题。提前致谢
TextRecognizer textRecognizer = new TextRecognizer.Builder(context).build();
textRecognizer.setProcessor(new OcrDetectorProcessor(mGraphicOverlay, OcrCaptureActivity.this));
if(!textRecognizer.isOperational()) {
Log.e("TextRecog","Not Operational"); IntentFilter lowstorageFilter = new
IntentFilter(Intent.ACTION_DEVICE_STORAGE_LOW); boolean hasLowStorage = registerReceiver(null, lowstorageFilter) != null;
}
【问题讨论】:
-
向我们展示您的代码
-
所有出现的“Am”都应该是“I”以表示正确的英语。
-
TextRecognizer textRecognizer = new TextRecognizer.Builder(context).build(); textRecognizer.setProcessor(new OcrDetectorProcessor(mGraphicOverlay, OcrCaptureActivity.this)); if(!textRecognizer.isOperational()){ Log.e("TextRecog","Not Operational"); IntentFilter lowstorageFilter = new IntentFilter(Intent.ACTION_DEVICE_STORAGE_LOW); boolean hasLowStorage = registerReceiver(null, lowstorageFilter) != null; }
-
@Matthias 非常感谢您的 cmets。我会改正的。
标签: android ocr google-vision vision-api