Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Vision API Text Recognizer is not working

I have used Google vision API to read text from any object like newspaper or text in wall. I have tried same sample from Google developer website but my Text Recognizer always return false on IsOperational function. am tested on Blackberry keyone and also tested on Moto x play its working fine.

Gradle file : compile 'com.google.android.gms:play-services-vision:11.0.4'

Can anyone help me on this. Thanks in Advance

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;
}
like image 974
venkatesh kumar Avatar asked Aug 31 '26 22:08

venkatesh kumar


1 Answers

add the vision api's metadata on your App manifest

 <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"/>