I set up ML-Kit like AndroidExample and using on-device recognition mode. It's working so well. but If we have a single character like 'A','5','K','9' it can't recognize anything! it only works for more than one length of string! I need to recognize only one character. What am I missing?!
This is my Function that gets a bitmap of an image and finds the texts from it.
private void RecognizeText(Bitmap bitmap) {
FirebaseVisionImage image = FirebaseVisionImage.fromBitmap(bitmap);
FirebaseVisionTextRecognizer detector = FirebaseVision.getInstance()
.getOnDeviceTextRecognizer();
Task<FirebaseVisionText> result =
detector.processImage(image)
.addOnSuccessListener(new OnSuccessListener<FirebaseVisionText>() {
@Override
public void onSuccess(FirebaseVisionText firebaseVisionText) {
String s = firebaseVisionText.getText() + " | " + firebaseVisionText.getText().length();
Toast.makeText(MainActivity.this, s, Toast.LENGTH_LONG).show();
textView.setText(s);
}
})
.addOnFailureListener(
new OnFailureListener() {
@Override
public void onFailure(Exception e) {
Log.d("EEEEEEEEVVVVVV", e.toString());
}
});
}