FirebaseVisionCloudTextDetector

public class FirebaseVisionCloudTextDetector extends Object
implements Closeable

Detector for performing optical character recognition(OCR) on an input image by sending the image to Google cloud ML backend.

A cloud text detector is created via getVisionCloudTextDetector(FirebaseVisionCloudDetectorOptions) or getVisionCloudTextDetector() if you wish to use the default FirebaseVisionCloudDetectorOptions. For example, the code below creates a cloud text detector with default options.


 FirebaseVisionCloudTextDetector cloudTextDetector =
    FirebaseVision.getInstance().getVisionCloudTextDetector();
 
To perform text detection in an image, you first need to create an instance of FirebaseVisionImage from a Bitmap, ByteBuffer, etc. See FirebaseVisionImage documentation for more details. For example, the code below creates a FirebaseVisionImage from a Bitmap.
      FirebaseVisionImage image = FirebaseVisionImage.fromBitmap(bitmap);
Then the code below can detect texts in the supplied FirebaseVisionImage.

 Task<FirebaseVisionCloudText> task = cloudTextDetector.detectInImage(image);
 task.addOnSuccessListener(...).addOnFailureListener(...);
 

Public Method Summary

void
Task<FirebaseVisionCloudText>
detectInImage(FirebaseVisionImage image)
Detects text from supplied image.

Inherited Method Summary

Object
clone()
boolean
equals(Object arg0)
void
finalize()
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()
abstract void
close()
abstract void
close()

Public Methods

public void close ()

Throws

public Task<FirebaseVisionCloudText> detectInImage (FirebaseVisionImage image)

Detects text from supplied image. If no text detected, the FirebaseVisionCloudText retrieved by the Task is null.

For best efficiency, create a FirebaseVisionImage object using one of the following ways:

All other FirebaseVisionImage factory methods will work as well, but possibly slightly slower.
Returns