I have been using Firebase MLkit to detect text within an image and I needed a way to figure out how I can detect the size of the text. I realize Kotlin has a way to do it, but I am working in Java so I was looking for a way to do it in Java on android studio.
I imagine I would need to add something to my detect text method below:
private void detectTextFromImage()
{
FirebaseVisionImage firebaseVisionImage = FirebaseVisionImage.fromBitmap(imageBitmap);
FirebaseVisionTextDetector firebaseVisionTextDetector = FirebaseVision.getInstance().getVisionTextDetector();
firebaseVisionTextDetector.detectInImage(firebaseVisionImage).addOnSuccessListener(new OnSuccessListener<FirebaseVisionText>() {
@Override
public void onSuccess(FirebaseVisionText firebaseVisionText) {
displayTextFromImage(firebaseVisionText);
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(PatientActivity.this, "Error: " + e.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
Thanks