我使用 Google Vision API 来读取报纸等任何物体上的文本或墙上的文本。我已经尝试过来自 Google 开发者网站的相同示例,但我的文本识别器总是返回 falseIsOperational
功能。我在 Blackberry keyone 上进行了测试,也在 Moto x 上进行了测试,运行良好。
摇篮文件: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;
}
在您的应用程序清单中添加视觉 API 的元数据
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.gms.vision.DEPENDENCIES"
android:value="ocr"/>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)